lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] m68k/setup: Use pr_*() instead of plain printk()
From
Date
On Mon, 2013-07-01 at 23:02 +0200, Geert Uytterhoeven wrote:
> On Mon, Jul 1, 2013 at 12:22 AM, Joe Perches <joe@perches.com> wrote:
> >> diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
> >
> >> @@ -161,7 +161,7 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
> > []
> >> - printk("m68k_parse_bootinfo: too many memory chunks\n");
> >> + pr_warn("m68k_parse_bootinfo: too many memory chunks\n");
> >
> > These are generally better written by
> > removing the hand-written function name
> > and using "%s: ", __func__
> >
> > pr_warn("%s: too many memory chunks\n",
> > __func__);
>
> I had tried that, too. But surprisingly (although the same function
> name was in two
> messages), it increased the size of the kernel image.

That's not surprising really.
There is more call frame stack per use too.

It does eliminate any issue with function renaming
though and is also less typo prone.

And, at some point, those __func__ uses could be
identified and rolled into a mechanism to emit the
function name via a standardized use of %pf and
__builtin_return_address(0) in the printk subsystem.

cheers, Joe



\
 
 \ /
  Last update: 2013-07-01 23:41    [W:0.050 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site