From: S.Caglar Onur Date: Mon, 28 Apr 2008 09:13:47 +0000 (-0700) Subject: arch/alpha/kernel/traps.c: use time_* macros X-Git-Tag: v2.6.26-rc1~915 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=037f436f525dac36c9f5fd5c5054518a63debb3e;p=linux-2.6 arch/alpha/kernel/traps.c: use time_* macros The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. So implement usage of the time_after() macro, defined in linux/jiffies.h, which deals with wrapping correctly [akpm@linux-foundation.org: fix warning] Signed-off-by: S.Caglar Onur Cc: Richard Henderson Cc: Ivan Kokshaysky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 2dc7f9fed2..dc57790250 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c @@ -8,6 +8,7 @@ * This file initializes the trap entry points */ +#include #include #include #include @@ -770,7 +771,7 @@ do_entUnaUser(void __user * va, unsigned long opcode, unsigned long reg, struct pt_regs *regs) { static int cnt = 0; - static long last_time = 0; + static unsigned long last_time; unsigned long tmp1, tmp2, tmp3, tmp4; unsigned long fake_reg, *reg_addr = &fake_reg; @@ -781,7 +782,7 @@ do_entUnaUser(void __user * va, unsigned long opcode, with the unaliged access. */ if (!test_thread_flag (TIF_UAC_NOPRINT)) { - if (cnt >= 5 && jiffies - last_time > 5*HZ) { + if (cnt >= 5 && time_after(jiffies, last_time + 5 * HZ)) { cnt = 0; } if (++cnt < 5) {