diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2010-02-27 19:58:16 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-04-07 04:00:50 -0400 |
commit | 8260cf6f40014860cb857f5245194900dd6c9b94 (patch) | |
tree | ca25c0ed7a370d622215b8d290af15794f93252e | |
parent | 7545ba6f82924d4523f8f8a2baf2e517a750265d (diff) |
powerpc/iseries/pci: Use __ratelimit
Replace open-coded rate limiting logic with __ratelimit().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index b841c9a9db87..3fc2e6494b8b 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/pci.h> | 33 | #include <linux/pci.h> |
34 | #include <linux/of.h> | 34 | #include <linux/of.h> |
35 | #include <linux/ratelimit.h> | ||
35 | 36 | ||
36 | #include <asm/types.h> | 37 | #include <asm/types.h> |
37 | #include <asm/io.h> | 38 | #include <asm/io.h> |
@@ -584,14 +585,9 @@ static inline struct device_node *xlate_iomm_address( | |||
584 | 585 | ||
585 | orig_addr = (unsigned long __force)addr; | 586 | orig_addr = (unsigned long __force)addr; |
586 | if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) { | 587 | if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) { |
587 | static unsigned long last_jiffies; | 588 | static DEFINE_RATELIMIT_STATE(ratelimit, 60 * HZ, 10); |
588 | static int num_printed; | ||
589 | 589 | ||
590 | if (time_after(jiffies, last_jiffies + 60 * HZ)) { | 590 | if (__ratelimit(&ratelimit)) |
591 | last_jiffies = jiffies; | ||
592 | num_printed = 0; | ||
593 | } | ||
594 | if (num_printed++ < 10) | ||
595 | printk(KERN_ERR | 591 | printk(KERN_ERR |
596 | "iSeries_%s: invalid access at IO address %p\n", | 592 | "iSeries_%s: invalid access at IO address %p\n", |
597 | func, addr); | 593 | func, addr); |