summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_pad.c
diff options
context:
space:
mode:
authorManuel Schölling <manuel.schoelling@gmx.de>2014-05-22 22:56:36 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-27 01:38:23 +0200
commit4ff248f3bf830ba22c988abb099e1836fbd3b1d0 (patch)
tree93c150501e425e72b8bdb815828a1d4325b75fa2 /drivers/acpi/acpi_pad.c
parentACPI / PAD: call schedule() when need_resched() is true (diff)
downloadlinux-4ff248f3bf830ba22c988abb099e1836fbd3b1d0.tar.xz
linux-4ff248f3bf830ba22c988abb099e1836fbd3b1d0.zip
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: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_pad.c')
-rw-r--r--drivers/acpi/acpi_pad.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index e20708f2b8e5..f148a0580e04 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -156,12 +156,13 @@ static int power_saving_thread(void *data)
while (!kthread_should_stop()) {
int cpu;
- u64 expire_time;
+ unsigned long expire_time;
try_to_freeze();
/* 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;
round_robin_cpu(tsk_index);
}
@@ -200,7 +201,7 @@ static int power_saving_thread(void *data)
CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
local_irq_enable();
- if (jiffies > expire_time) {
+ if (time_before(expire_time, jiffies)) {
do_sleep = 1;
break;
}