aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-11-28 11:35:25 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-28 11:52:50 -0500
commit74853dba2f7a1a9b0905a09abcf65c1f3ce0b14f (patch)
tree8b054f73abe37b6201d2e2efb8e79887737ee32e /kernel/panic.c
parent7fbb8759eff9a348efa5f352ffaa51c364837c4b (diff)
debug warnings: consolidate warn_slowpath and warn_on_slowpath
Impact: cleanup, code reduction warn_slowpath is a superset of warn_on_slowpath; just have warn_on_slowpath call warn_slowpath with a NULL 3rd argument. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 6513aac8e992..6bbf7b905c76 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -320,23 +320,6 @@ void oops_exit(void)
320} 320}
321 321
322#ifdef WANT_WARN_ON_SLOWPATH 322#ifdef WANT_WARN_ON_SLOWPATH
323void warn_on_slowpath(const char *file, int line)
324{
325 char function[KSYM_SYMBOL_LEN];
326 unsigned long caller = (unsigned long) __builtin_return_address(0);
327 sprint_symbol(function, caller);
328
329 printk(KERN_WARNING "------------[ cut here ]------------\n");
330 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
331 line, function);
332 print_modules();
333 dump_stack();
334 print_oops_end_marker();
335 add_taint(TAINT_WARN);
336}
337EXPORT_SYMBOL(warn_on_slowpath);
338
339
340void warn_slowpath(const char *file, int line, const char *fmt, ...) 323void warn_slowpath(const char *file, int line, const char *fmt, ...)
341{ 324{
342 va_list args; 325 va_list args;
@@ -347,9 +330,12 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
347 printk(KERN_WARNING "------------[ cut here ]------------\n"); 330 printk(KERN_WARNING "------------[ cut here ]------------\n");
348 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, 331 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
349 line, function); 332 line, function);
350 va_start(args, fmt); 333
351 vprintk(fmt, args); 334 if (fmt) {
352 va_end(args); 335 va_start(args, fmt);
336 vprintk(fmt, args);
337 va_end(args);
338 }
353 339
354 print_modules(); 340 print_modules();
355 dump_stack(); 341 dump_stack();
@@ -357,6 +343,12 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
357 add_taint(TAINT_WARN); 343 add_taint(TAINT_WARN);
358} 344}
359EXPORT_SYMBOL(warn_slowpath); 345EXPORT_SYMBOL(warn_slowpath);
346
347void warn_on_slowpath(const char *file, int line)
348{
349 warn_slowpath(file, line, NULL);
350}
351EXPORT_SYMBOL(warn_on_slowpath);
360#endif 352#endif
361 353
362#ifdef CONFIG_CC_STACKPROTECTOR 354#ifdef CONFIG_CC_STACKPROTECTOR