Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Fabian Frederick <fabf@skynet.be>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Fabian Frederick and committed by
Linus Torvalds
c56ba703 ce643a30

+10 -11
+10 -11
lib/bug.c
··· 37 37 38 38 Jeremy Fitzhardinge <jeremy@goop.org> 2006 39 39 */ 40 + 41 + #define pr_fmt(fmt) fmt 42 + 40 43 #include <linux/list.h> 41 44 #include <linux/module.h> 42 45 #include <linux/kernel.h> ··· 156 153 157 154 if (warning) { 158 155 /* this is a WARN_ON rather than BUG/BUG_ON */ 159 - printk(KERN_WARNING "------------[ cut here ]------------\n"); 156 + pr_warn("------------[ cut here ]------------\n"); 160 157 161 158 if (file) 162 - printk(KERN_WARNING "WARNING: at %s:%u\n", 163 - file, line); 159 + pr_warn("WARNING: at %s:%u\n", file, line); 164 160 else 165 - printk(KERN_WARNING "WARNING: at %p " 166 - "[verbose debug info unavailable]\n", 167 - (void *)bugaddr); 161 + pr_warn("WARNING: at %p [verbose debug info unavailable]\n", 162 + (void *)bugaddr); 168 163 169 164 print_modules(); 170 165 show_regs(regs); ··· 175 174 printk(KERN_DEFAULT "------------[ cut here ]------------\n"); 176 175 177 176 if (file) 178 - printk(KERN_CRIT "kernel BUG at %s:%u!\n", 179 - file, line); 177 + pr_crit("kernel BUG at %s:%u!\n", file, line); 180 178 else 181 - printk(KERN_CRIT "Kernel BUG at %p " 182 - "[verbose debug info unavailable]\n", 183 - (void *)bugaddr); 179 + pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n", 180 + (void *)bugaddr); 184 181 185 182 return BUG_TRAP_TYPE_BUG; 186 183 }