summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/bug.h
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-16 01:43:18 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-09-17 04:39:33 +0200
commit45e9c0de2e86485f8b6633fd64ab19cfbff167f6 (patch)
tree0d4b478f259ea083e3f94363eebdf518413162ae /include/asm-generic/bug.h
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pen... (diff)
downloadlinux-45e9c0de2e86485f8b6633fd64ab19cfbff167f6.tar.xz
linux-45e9c0de2e86485f8b6633fd64ab19cfbff167f6.zip
warn: Turn the netdev timeout WARN_ON() into a WARN()
this patch turns the netdev timeout WARN_ON_ONCE() into a WARN_ONCE(), so that the device and driver names are inside the warning message. This helps automated tools like kerneloops.org to collect the data and do statistics, as well as making it more likely that humans cut-n-paste the important message as part of a bugreport. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r--include/asm-generic/bug.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index a3f738cffdb6..edc6ba82e090 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -97,6 +97,16 @@ extern void warn_slowpath(const char *file, const int line,
unlikely(__ret_warn_once); \
})
+#define WARN_ONCE(condition, format...) ({ \
+ static int __warned; \
+ int __ret_warn_once = !!(condition); \
+ \
+ if (unlikely(__ret_warn_once)) \
+ if (WARN(!__warned, format)) \
+ __warned = 1; \
+ unlikely(__ret_warn_once); \
+})
+
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state))