瀏覽代碼

bug: when !CONFIG_BUG, make WARN call no_printk to check format and args

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>
Josh Triplett 11 年之前
父節點
當前提交
4e50ebde32
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      include/asm-generic/bug.h

+ 1 - 0
include/asm-generic/bug.h

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