lkml.org 
[lkml]   [2009]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: x86, vmi: TSC going backwards check in vmi clocksource
From
Date
On Fri, 2009-02-20 at 09:58 -0800, Ingo Molnar wrote:
> * Alok Kataria <akataria@vmware.com> wrote:
>
> > static cycle_t read_real_cycles(void)
> > {
> > - return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
> > + cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
> > + return ret >= clocksource_vmi.cycle_last ?
> > + ret : clocksource_vmi.cycle_last;
>
> btw., could you please clean this up to use max()?

Please find it below, on top of current tip/master.

--

cleanup vmi_read_cycles to use max()

Signed-off-by: Alok N Kataria <akataria@vmware.com>

---

arch/x86/kernel/vmiclock_32.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 9cd28c0..b77ad57 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -288,8 +288,7 @@ static struct clocksource clocksource_vmi;
static cycle_t read_real_cycles(void)
{
cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
- return ret >= clocksource_vmi.cycle_last ?
- ret : clocksource_vmi.cycle_last;
+ return max(ret, clocksource_vmi.cycle_last);
}

static struct clocksource clocksource_vmi = {



\
 
 \ /
  Last update: 2009-02-20 19:25    [W:0.097 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site