Commit fdb17aeb authored by Alok Kataria's avatar Alok Kataria Committed by Ingo Molnar

x86, vmi: TSC going backwards check in vmi clocksource, cleanup

clean up vmi_read_cycles to use max()

Reported-b: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAlok N Kataria <akataria@vmware.com>
Cc: Zach Amsden <zach@vmware.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 60916285
...@@ -288,8 +288,7 @@ static struct clocksource clocksource_vmi; ...@@ -288,8 +288,7 @@ static struct clocksource clocksource_vmi;
static cycle_t read_real_cycles(void) static cycle_t read_real_cycles(void)
{ {
cycle_t ret = (cycle_t)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 ? return max(ret, clocksource_vmi.cycle_last);
ret : clocksource_vmi.cycle_last;
} }
static struct clocksource clocksource_vmi = { static struct clocksource clocksource_vmi = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment