diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 20:00:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 20:00:17 -0400 |
commit | 3f5785ec31adcb7cafa9135087297a38d9698cf8 (patch) | |
tree | b7d06f14e1aea0292a88c4bc0305ea602f6ebd33 /include/asm-generic | |
parent | 8c1c77ff9be27137fa7cbbf51efedef1a2ae915b (diff) | |
parent | 94265cf5f731c7df29fdfde262ca3e6d51e6828c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (89 commits)
bonding: documentation and code cleanup for resend_igmp
bonding: prevent deadlock on slave store with alb mode (v3)
net: hold rtnl again in dump callbacks
Add Fujitsu 1000base-SX PCI ID to tg3
bnx2x: protect sequence increment with mutex
sch_sfq: fix peek() implementation
isdn: netjet - blacklist Digium TDM400P
via-velocity: don't annotate MAC registers as packed
xen: netfront: hold RTNL when updating features.
sctp: fix memory leak of the ASCONF queue when free asoc
net: make dev_disable_lro use physical device if passed a vlan dev (v2)
net: move is_vlan_dev into public header file (v2)
bug.h: Fix build with CONFIG_PRINTK disabled.
wireless: fix fatal kernel-doc error + warning in mac80211.h
wireless: fix cfg80211.h new kernel-doc warnings
iwlagn: dbg_fixed_rate only used when CONFIG_MAC80211_DEBUGFS enabled
dst: catch uninitialized metrics
be2net: hash key for rss-config cmd not set
bridge: initialize fake_rtable metrics
net: fix __dst_destroy_metrics_generic()
...
Fix up trivial conflicts in drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/bug.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index e5a3f5880001..91784841e407 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -162,9 +162,46 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
162 | unlikely(__ret_warn_once); \ | 162 | unlikely(__ret_warn_once); \ |
163 | }) | 163 | }) |
164 | 164 | ||
165 | #ifdef CONFIG_PRINTK | ||
166 | |||
165 | #define WARN_ON_RATELIMIT(condition, state) \ | 167 | #define WARN_ON_RATELIMIT(condition, state) \ |
166 | WARN_ON((condition) && __ratelimit(state)) | 168 | WARN_ON((condition) && __ratelimit(state)) |
167 | 169 | ||
170 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
171 | ({ \ | ||
172 | int rtn = 0; \ | ||
173 | if (unlikely(__ratelimit(state))) \ | ||
174 | rtn = WARN(condition, format); \ | ||
175 | rtn; \ | ||
176 | }) | ||
177 | |||
178 | #define WARN_RATELIMIT(condition, format...) \ | ||
179 | ({ \ | ||
180 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
181 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
182 | DEFAULT_RATELIMIT_BURST); \ | ||
183 | __WARN_RATELIMIT(condition, &_rs, format); \ | ||
184 | }) | ||
185 | |||
186 | #else | ||
187 | |||
188 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
189 | WARN_ON(condition) | ||
190 | |||
191 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
192 | ({ \ | ||
193 | int rtn = WARN(condition, format); \ | ||
194 | rtn; \ | ||
195 | }) | ||
196 | |||
197 | #define WARN_RATELIMIT(condition, format...) \ | ||
198 | ({ \ | ||
199 | int rtn = WARN(condition, format); \ | ||
200 | rtn; \ | ||
201 | }) | ||
202 | |||
203 | #endif | ||
204 | |||
168 | /* | 205 | /* |
169 | * WARN_ON_SMP() is for cases that the warning is either | 206 | * WARN_ON_SMP() is for cases that the warning is either |
170 | * meaningless for !SMP or may even cause failures. | 207 | * meaningless for !SMP or may even cause failures. |