Commit c56ba703 authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds

lib/bug.c: convert printk to pr_foo()

- Coalesce formats

- "WARNING:" prefix unchanged to keep bug format.

- printk(KERN_DEFAULT not converted.

- define pr_fmt without prefix to avoid any default prefix update
  (suggested by Joe Perches).
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ce643a30
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
Jeremy Fitzhardinge <jeremy@goop.org> 2006 Jeremy Fitzhardinge <jeremy@goop.org> 2006
*/ */
#define pr_fmt(fmt) fmt
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -153,15 +156,13 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) ...@@ -153,15 +156,13 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
if (warning) { if (warning) {
/* this is a WARN_ON rather than BUG/BUG_ON */ /* this is a WARN_ON rather than BUG/BUG_ON */
printk(KERN_WARNING "------------[ cut here ]------------\n"); pr_warn("------------[ cut here ]------------\n");
if (file) if (file)
printk(KERN_WARNING "WARNING: at %s:%u\n", pr_warn("WARNING: at %s:%u\n", file, line);
file, line);
else else
printk(KERN_WARNING "WARNING: at %p " pr_warn("WARNING: at %p [verbose debug info unavailable]\n",
"[verbose debug info unavailable]\n", (void *)bugaddr);
(void *)bugaddr);
print_modules(); print_modules();
show_regs(regs); show_regs(regs);
...@@ -174,12 +175,10 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) ...@@ -174,12 +175,10 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
printk(KERN_DEFAULT "------------[ cut here ]------------\n"); printk(KERN_DEFAULT "------------[ cut here ]------------\n");
if (file) if (file)
printk(KERN_CRIT "kernel BUG at %s:%u!\n", pr_crit("kernel BUG at %s:%u!\n", file, line);
file, line);
else else
printk(KERN_CRIT "Kernel BUG at %p " pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n",
"[verbose debug info unavailable]\n", (void *)bugaddr);
(void *)bugaddr);
return BUG_TRAP_TYPE_BUG; return BUG_TRAP_TYPE_BUG;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment