diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-04 19:11:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:19 -0400 |
commit | c56ba70331d9f3c1ea77f8053095fb05fe773f50 (patch) | |
tree | e397ee39facb5fb7697508ade79083bcfc5a5324 /lib | |
parent | ce643a30d1c8bd31b6310f59f6d7236c9904c3bf (diff) |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bug.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -37,6 +37,9 @@ | |||
37 | 37 | ||
38 | Jeremy Fitzhardinge <jeremy@goop.org> 2006 | 38 | Jeremy Fitzhardinge <jeremy@goop.org> 2006 |
39 | */ | 39 | */ |
40 | |||
41 | #define pr_fmt(fmt) fmt | ||
42 | |||
40 | #include <linux/list.h> | 43 | #include <linux/list.h> |
41 | #include <linux/module.h> | 44 | #include <linux/module.h> |
42 | #include <linux/kernel.h> | 45 | #include <linux/kernel.h> |
@@ -153,15 +156,13 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
153 | 156 | ||
154 | if (warning) { | 157 | if (warning) { |
155 | /* this is a WARN_ON rather than BUG/BUG_ON */ | 158 | /* this is a WARN_ON rather than BUG/BUG_ON */ |
156 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | 159 | pr_warn("------------[ cut here ]------------\n"); |
157 | 160 | ||
158 | if (file) | 161 | if (file) |
159 | printk(KERN_WARNING "WARNING: at %s:%u\n", | 162 | pr_warn("WARNING: at %s:%u\n", file, line); |
160 | file, line); | ||
161 | else | 163 | else |
162 | printk(KERN_WARNING "WARNING: at %p " | 164 | pr_warn("WARNING: at %p [verbose debug info unavailable]\n", |
163 | "[verbose debug info unavailable]\n", | 165 | (void *)bugaddr); |
164 | (void *)bugaddr); | ||
165 | 166 | ||
166 | print_modules(); | 167 | print_modules(); |
167 | show_regs(regs); | 168 | show_regs(regs); |
@@ -174,12 +175,10 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
174 | printk(KERN_DEFAULT "------------[ cut here ]------------\n"); | 175 | printk(KERN_DEFAULT "------------[ cut here ]------------\n"); |
175 | 176 | ||
176 | if (file) | 177 | if (file) |
177 | printk(KERN_CRIT "kernel BUG at %s:%u!\n", | 178 | pr_crit("kernel BUG at %s:%u!\n", file, line); |
178 | file, line); | ||
179 | else | 179 | else |
180 | printk(KERN_CRIT "Kernel BUG at %p " | 180 | pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n", |
181 | "[verbose debug info unavailable]\n", | 181 | (void *)bugaddr); |
182 | (void *)bugaddr); | ||
183 | 182 | ||
184 | return BUG_TRAP_TYPE_BUG; | 183 | return BUG_TRAP_TYPE_BUG; |
185 | } | 184 | } |