diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2010-02-28 05:58:14 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2010-05-18 17:45:54 -0400 |
commit | 7683a3f9748f7adfbe47e33002a4f710ab557293 (patch) | |
tree | 468c3ef3126f84a1a35891a5213f4c517113160e /arch/ia64/kernel/irq_ia64.c | |
parent | 552dce3a071f0de2a84023fbba7f3b4ac36602cd (diff) |
[IA64] use __ratelimit
Replace open-coded rate limiting logic with __ratelimit().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/irq_ia64.c')
-rw-r--r-- | arch/ia64/kernel/irq_ia64.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 640479304ac0..f14c35f9b03a 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/threads.h> | 29 | #include <linux/threads.h> |
30 | #include <linux/bitops.h> | 30 | #include <linux/bitops.h> |
31 | #include <linux/irq.h> | 31 | #include <linux/irq.h> |
32 | #include <linux/ratelimit.h> | ||
32 | 33 | ||
33 | #include <asm/delay.h> | 34 | #include <asm/delay.h> |
34 | #include <asm/intrinsics.h> | 35 | #include <asm/intrinsics.h> |
@@ -467,13 +468,9 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs) | |||
467 | sp = ia64_getreg(_IA64_REG_SP); | 468 | sp = ia64_getreg(_IA64_REG_SP); |
468 | 469 | ||
469 | if ((sp - bsp) < 1024) { | 470 | if ((sp - bsp) < 1024) { |
470 | static unsigned char count; | 471 | static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); |
471 | static long last_time; | ||
472 | 472 | ||
473 | if (time_after(jiffies, last_time + 5 * HZ)) | 473 | if (__ratelimit(&ratelimit)) { |
474 | count = 0; | ||
475 | if (++count < 5) { | ||
476 | last_time = jiffies; | ||
477 | printk("ia64_handle_irq: DANGER: less than " | 474 | printk("ia64_handle_irq: DANGER: less than " |
478 | "1KB of free stack space!!\n" | 475 | "1KB of free stack space!!\n" |
479 | "(bsp=0x%lx, sp=%lx)\n", bsp, sp); | 476 | "(bsp=0x%lx, sp=%lx)\n", bsp, sp); |