bug: when !CONFIG_BUG, make WARN call no_printk to check format and args
authorJosh Triplett <josh@joshtriplett.org>
Mon, 7 Apr 2014 22:39:12 +0000 (15:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:36:10 +0000 (16:36 -0700)
The stub version of WARN for !CONFIG_BUG completely ignored its format
string and subsequent arguments; make it check them instead, using
no_printk.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-generic/bug.h

index 2d54d8df7bd1896eef1b5d30f20beff323884cf3..a97fa11aaf41990a62cb5955510c8f77c48db5a1 100644 (file)
@@ -155,6 +155,7 @@ extern void warn_slowpath_null(const char *file, const int line);
 #ifndef WARN
 #define WARN(condition, format...) ({                                  \
        int __ret_warn_on = !!(condition);                              \
+       no_printk(format);                                              \
        unlikely(__ret_warn_on);                                        \
 })
 #endif