Re: [RFC] introduce pr_cont macro

From: Cyrill Gorcunov
Date: Wed Feb 25 2009 - 23:04:39 EST


On 2/26/09, Ingo Molnar <mingo@xxxxxxx> wrote:
>
> * Harvey Harrison <harvey.harrison@xxxxxxxxx> wrote:
>
>> On Thu, 2009-02-26 at 04:13 +0100, Ingo Molnar wrote:
>> > * Harvey Harrison <harvey.harrison@xxxxxxxxx> wrote:
>> >
>> > > On Thu, 2009-02-26 at 04:03 +0100, Ingo Molnar wrote:
>> > > > * Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
>> > > >
>> > > > > We cover all log-levels by pr_... macros except
>> > > > > KERN_CONT one. Add it for convenience.
>> > > > >
>> > > > > Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
>> > > > > ---
>> > > > >
>> > > > > I think start printing with some pr_... macro
>> > > > > and continue with printk(KERN_CONT ...) look
>> > > > > not that clear -- better to continue with
>> > > > > same pr_... slogan. Thoughts? I hope I didn't
>> > > > > miss anything.
>> > > > >
>> > > > > include/linux/kernel.h | 2 ++
>> > > > > 1 file changed, 2 insertions(+)
>> > > > >
>> > > > > Index: linux-2.6.git/include/linux/kernel.h
>> > > > > ===================================================================
>> > > > > --- linux-2.6.git.orig/include/linux/kernel.h
>> > > > > +++ linux-2.6.git/include/linux/kernel.h
>> > > > > @@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char *
>> > > > > printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
>> > > > > #define pr_info(fmt, ...) \
>> > > > > printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
>> > > > > +#define pr_cont(fmt, ...) \
>> > > > > + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
>> > > >
>> > > > Makes sense.
>> > > >
>> > > > Acked-by: Ingo Molnar <mingo@xxxxxxx>
>> > > >
>> > >
>> > > Don't you want to omit the pr_fmt() from the KERN_CONT case?
>> >
>> > indeed, good catch. It should be:
>> >
>> > #define pr_cont(fmt, ...) \
>> > printk(KERN_CONT ##__VA_ARGS__)
>>
>> Missing fmt entirely?
>
> yeah ...
>
> Btw., why do those macros use ##__VA_ARGS__ ? Why not a
> straightforward:
>
> #define __pr_cont(args...) \
> printk(KERN_CONT args)
>
> ?
>
> Ingo

Grr... Thanks for catching me! Ingo, Harvey could you drop this patch
and make new one in good shape?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/