diff options
author | Guillaume Chazarain <guichaz@yahoo.fr> | 2007-11-19 12:07:00 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-11-21 00:43:17 +0300 |
commit | 92468c53cf5af0aea06caec7b7d416c18e973685 (patch) | |
tree | f030ad479614a0832585d549d51d4ff8fb3f264f /include/net/ieee80211.h | |
parent | 4b50e388f88ab08f6c2f54f0a33e696ff2de269f (diff) | |
download | linux-92468c53cf5af0aea06caec7b7d416c18e973685.tar.xz |
ieee80211: Stop net_ratelimit/IEEE80211_DEBUG_DROP log pollution
if (net_ratelimit())
IEEE80211_DEBUG_DROP(...)
can pollute the logs with messages like:
printk: 1 messages suppressed.
printk: 2 messages suppressed.
printk: 7 messages suppressed.
if debugging information is disabled. These messages are printed by
net_ratelimit(). Add a wrapper to net_ratelimit() that takes into account
the log level, so that net_ratelimit() is called only when we really want
to print something.
Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/ieee80211.h')
-rw-r--r-- | include/net/ieee80211.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 164d13211165..d8ae48439f12 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h @@ -115,8 +115,16 @@ extern u32 ieee80211_debug_level; do { if (ieee80211_debug_level & (level)) \ printk(KERN_DEBUG "ieee80211: %c %s " fmt, \ in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) +static inline bool ieee80211_ratelimit_debug(u32 level) +{ + return (ieee80211_debug_level & level) && net_ratelimit(); +} #else #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) +static inline bool ieee80211_ratelimit_debug(u32 level) +{ + return false; +} #endif /* CONFIG_IEEE80211_DEBUG */ /* escape_essid() is intended to be used in debug (and possibly error) |