[IA64] arch/ia64/kernel/: use time_* macros
authorS.Caglar Onur <caglar@pardus.org.tr>
Fri, 28 Mar 2008 21:27:05 +0000 (14:27 -0700)
committerTony Luck <tony.luck@intel.com>
Wed, 9 Apr 2008 17:38:30 +0000 (10:38 -0700)
The functions time_before, time_before_eq, time_after, and time_after_eq are
more robust for comparing jiffies against other values.

So use the time_after() & time_before() macros, defined at linux/jiffies.h,
which deal with wrapping correctly

[akpm@linux-foundation.org: coding-style fixes]

Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/unaligned.c

index d8be23fbe6bc7bbf0668a01f55fe3dd7813a6f29..5538471e8d68dc663df1656d9564f74ad11fe806 100644 (file)
@@ -472,7 +472,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
                        static unsigned char count;
                        static long last_time;
 
-                       if (jiffies - last_time > 5*HZ)
+                       if (time_after(jiffies, last_time + 5 * HZ))
                                count = 0;
                        if (++count < 5) {
                                last_time = jiffies;
index 338dbb8c2cfcb1ebe081165be2463ec64b53a43b..1ae512910870da963c3cfe6fe9695dd443bf821d 100644 (file)
@@ -69,6 +69,7 @@
  * 2007-04-27 Russ Anderson <rja@sgi.com>
  *           Support multiple cpus going through OS_MCA in the same event.
  */
+#include <linux/jiffies.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -293,7 +294,8 @@ static void ia64_mlogbuf_dump_from_init(void)
        if (mlogbuf_finished)
                return;
 
-       if (mlogbuf_timestamp && (mlogbuf_timestamp + 30*HZ > jiffies)) {
+       if (mlogbuf_timestamp &&
+                       time_before(jiffies, mlogbuf_timestamp + 30 * HZ)) {
                printk(KERN_ERR "INIT: mlogbuf_dump is interrupted by INIT "
                        " and the system seems to be messed up.\n");
                ia64_mlogbuf_finish(0);
index 6903361d11a5766e54f2b8b0e64f5a4d892e2538..ff0e7c10faa7222d48964d355bf3322b45506800 100644 (file)
@@ -13,6 +13,7 @@
  * 2001/08/13  Correct size of extended floats (float_fsz) from 16 to 10 bytes.
  * 2001/01/17  Add support emulation of unaligned kernel accesses.
  */
+#include <linux/jiffies.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
@@ -1290,7 +1291,7 @@ within_logging_rate_limit (void)
 {
        static unsigned long count, last_time;
 
-       if (jiffies - last_time > 5*HZ)
+       if (time_after(jiffies, last_time + 5 * HZ))
                count = 0;
        if (count < 5) {
                last_time = jiffies;