* [PATCH 1/1] lib/bug.c: convert printk to pr_foo()
@ 2014-05-24 6:18 Fabian Frederick
2014-05-24 6:35 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2014-05-24 6:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeremy Fitzhardinge, akpm
-Coalesce formats
-"WARNING:" prefix unchanged to keep bug format.
-printk(KERN_DEFAULT not converted.
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
lib/bug.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/lib/bug.c b/lib/bug.c
index 1686034..2e9f9bc 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -153,15 +153,13 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
if (warning) {
/* this is a WARN_ON rather than BUG/BUG_ON */
- printk(KERN_WARNING "------------[ cut here ]------------\n");
+ pr_warn("------------[ cut here ]------------\n");
if (file)
- printk(KERN_WARNING "WARNING: at %s:%u\n",
- file, line);
+ pr_warn("WARNING: at %s:%u\n", file, line);
else
- printk(KERN_WARNING "WARNING: at %p "
- "[verbose debug info unavailable]\n",
- (void *)bugaddr);
+ pr_warn("WARNING: at %p [verbose debug info unavailable]\n",
+ (void *)bugaddr);
print_modules();
show_regs(regs);
@@ -174,12 +172,10 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
printk(KERN_DEFAULT "------------[ cut here ]------------\n");
if (file)
- printk(KERN_CRIT "kernel BUG at %s:%u!\n",
- file, line);
+ pr_crit("kernel BUG at %s:%u!\n", file, line);
else
- printk(KERN_CRIT "Kernel BUG at %p "
- "[verbose debug info unavailable]\n",
- (void *)bugaddr);
+ pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n",
+ (void *)bugaddr);
return BUG_TRAP_TYPE_BUG;
}
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] lib/bug.c: convert printk to pr_foo()
2014-05-24 6:18 [PATCH 1/1] lib/bug.c: convert printk to pr_foo() Fabian Frederick
@ 2014-05-24 6:35 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2014-05-24 6:35 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Jeremy Fitzhardinge, akpm
On Sat, 2014-05-24 at 08:18 +0200, Fabian Frederick wrote:
> -Coalesce formats
> -"WARNING:" prefix unchanged to keep bug format.
> -printk(KERN_DEFAULT not converted.
Hello Fabian.
For these conversions where there is a specific
desire to _NOT_ have a prefix, can you please add
a new #define to the file?
#define pr_fmt(fmt) fmt
so that if ever the default in printk.h is changed,
these will not be prefixed.
> diff --git a/lib/bug.c b/lib/bug.c
[]
> @@ -153,15 +153,13 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
>
> if (warning) {
> /* this is a WARN_ON rather than BUG/BUG_ON */
> - printk(KERN_WARNING "------------[ cut here ]------------\n");
> + pr_warn("------------[ cut here ]------------\n");
Thanks, Joe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-24 6:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-24 6:18 [PATCH 1/1] lib/bug.c: convert printk to pr_foo() Fabian Frederick
2014-05-24 6:35 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®