aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2009-05-06 19:02:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-06 19:36:09 -0400
commit57adc4d2dbf968fdbe516359688094eef4d46581 (patch)
tree69e84c0feb47f0d6b677266d12635f54636528d7 /kernel/panic.c
parent429aa0fca0df702fc9c81d799175a7d920398827 (diff)
Eliminate thousands of warnings with gcc 3.2 build
When building with gcc 3.2 I get thousands of warnings such as include/linux/gfp.h: In function `allocflags_to_migratetype': include/linux/gfp.h:105: warning: null format string due to passing a NULL format string to warn_slowpath() in #define __WARN() warn_slowpath(__FILE__, __LINE__, NULL) Split this case out into a separate call. This also shrinks the kernel slightly: text data bss dec hex filename 4802274 707668 712704 6222646 5ef336 vmlinux text data bss dec hex filename 4799027 703572 712704 6215303 5ed687 vmlinux due to removeing one argument from the commonly-called __WARN(). [akpm@linux-foundation.org: reduce scope of `empty'] Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 3dcaa1661357..874ecf1307ae 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -340,7 +340,7 @@ void oops_exit(void)
340} 340}
341 341
342#ifdef WANT_WARN_ON_SLOWPATH 342#ifdef WANT_WARN_ON_SLOWPATH
343void warn_slowpath(const char *file, int line, const char *fmt, ...) 343void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
344{ 344{
345 va_list args; 345 va_list args;
346 char function[KSYM_SYMBOL_LEN]; 346 char function[KSYM_SYMBOL_LEN];
@@ -356,7 +356,7 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
356 if (board) 356 if (board)
357 printk(KERN_WARNING "Hardware name: %s\n", board); 357 printk(KERN_WARNING "Hardware name: %s\n", board);
358 358
359 if (fmt) { 359 if (*fmt) {
360 va_start(args, fmt); 360 va_start(args, fmt);
361 vprintk(fmt, args); 361 vprintk(fmt, args);
362 va_end(args); 362 va_end(args);
@@ -367,7 +367,14 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
367 print_oops_end_marker(); 367 print_oops_end_marker();
368 add_taint(TAINT_WARN); 368 add_taint(TAINT_WARN);
369} 369}
370EXPORT_SYMBOL(warn_slowpath); 370EXPORT_SYMBOL(warn_slowpath_fmt);
371
372void warn_slowpath_null(const char *file, int line)
373{
374 static const char *empty = "";
375 warn_slowpath_fmt(file, line, empty);
376}
377EXPORT_SYMBOL(warn_slowpath_null);
371#endif 378#endif
372 379
373#ifdef CONFIG_CC_STACKPROTECTOR 380#ifdef CONFIG_CC_STACKPROTECTOR