Commit 4ff248f3 authored by Manuel Schölling's avatar Manuel Schölling Committed by Rafael J. Wysocki

ACPI / PAD: Use time_before() for time comparison

To be future-proof and for better readability the time comparisons are
modified to use time_before() instead of plain, error-prone math.
Signed-off-by: default avatarManuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5b59c69e
...@@ -156,12 +156,13 @@ static int power_saving_thread(void *data) ...@@ -156,12 +156,13 @@ static int power_saving_thread(void *data)
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
int cpu; int cpu;
u64 expire_time; unsigned long expire_time;
try_to_freeze(); try_to_freeze();
/* round robin to cpus */ /* round robin to cpus */
if (last_jiffies + round_robin_time * HZ < jiffies) { expire_time = last_jiffies + round_robin_time * HZ;
if (time_before(expire_time, jiffies)) {
last_jiffies = jiffies; last_jiffies = jiffies;
round_robin_cpu(tsk_index); round_robin_cpu(tsk_index);
} }
...@@ -200,7 +201,7 @@ static int power_saving_thread(void *data) ...@@ -200,7 +201,7 @@ static int power_saving_thread(void *data)
CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu); CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
local_irq_enable(); local_irq_enable();
if (jiffies > expire_time) { if (time_before(expire_time, jiffies)) {
do_sleep = 1; do_sleep = 1;
break; break;
} }
......
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