]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kernel/timer.c: fix jiffies wrap behavior of round_jiffies*()
authorBart Van Assche <bart.vanassche@gmail.com>
Wed, 19 Jun 2013 00:05:33 +0000 (10:05 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:12:45 +0000 (17:12 +1000)
Make sure that the round_jiffies*() functions return a time that is
in the future when the jiffies counter has recently wrapped.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/timer.c

index 15ffdb3f1948b9468c2c04527beb8190b0d79d45..aa8b9642118b936804654d0c83ad01251439c0c3 100644 (file)
@@ -149,9 +149,7 @@ static unsigned long round_jiffies_common(unsigned long j, int cpu,
        /* now that we have rounded, subtract the extra skew again */
        j -= cpu * 3;
 
-       if (j <= jiffies) /* rounding ate our timeout entirely; */
-               return original;
-       return j;
+       return time_is_after_jiffies(j) ? j : original;
 }
 
 /**