lkml.org 
[lkml]   [2008]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] Add PR_PREFIX to pr_xyz macros.
From
Date
On Wed, 2008-11-12 at 11:48 -0800, Linus Torvalds wrote:
>
> On Wed, 12 Nov 2008, Martin Schwidefsky wrote:
> >
> > +#ifndef PR_PREFIX
> > +#define pr_fmt(format) format
> > +#else
> > +#define pr_fmt(format) PR_PREFIX ": " format
> > +#endif
> > +
> > +#define pr_emerg(fmt, ...) \
> > + printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
>
> So, why can't people just define their pr_fmt() macro directly, something
> like
>
> #define pr_fmt(fmt) \
> "%s:%d " fmt, __FILE__, __LINE__
>
> which seems to be much more useful and generic than forcing them to use
> "PR_PREFIX"?

Even better - much better. With that define a lot more printk wrappers
could be replaced. I'll come up with a patch.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.




\
 
 \ /
  Last update: 2008-11-12 21:07    [W:0.063 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site