diff options
author | S.Caglar Onur <caglar@pardus.org.tr> | 2008-04-28 02:13:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 08:58:27 -0700 |
commit | 037f436f525dac36c9f5fd5c5054518a63debb3e (patch) | |
tree | 142ca318b163cb3058882a68a405526b19856d1a /arch | |
parent | 95d193a90335b4e39dd1f750f1fc1672339ff487 (diff) | |
download | linux-stable-037f436f525dac36c9f5fd5c5054518a63debb3e.tar.gz linux-stable-037f436f525dac36c9f5fd5c5054518a63debb3e.tar.bz2 linux-stable-037f436f525dac36c9f5fd5c5054518a63debb3e.zip |
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 <caglar@pardus.org.tr>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/traps.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 2dc7f9fed213..dc57790250d2 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 <linux/jiffies.h> #include <linux/mm.h> #include <linux/sched.h> #include <linux/tty.h> @@ -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) { |