Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit fdb17aeb authored by Alok Kataria's avatar Alok Kataria Committed by Ingo Molnar
Browse files

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
Branches
No related tags found
No related merge requests found
...@@ -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 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment