lkml.org 
[lkml]   [2018]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH TRIVIAL] bsg: use pr_debug instead of hand crafted macros
From
Date
On Mon, 2018-01-22 at 20:42 +0000, Bart Van Assche wrote:
> On Mon, 2018-01-22 at 12:23 -0800, Joe Perches wrote:
> > On Mon, 2018-01-22 at 08:53 +0100, Johannes Thumshirn wrote:
> > > Use pr_debug instead of hand crafted macros. This way it is not needed to
> > > re-compile the kernel to enable bsg debug outputs and it's possible to
> > > selectively enable specific prints.
> >
> > Perhaps better to use
> >
> > #define bsg_dbg(bd, fmt, ...) \
> > pr_debug(bd->name, fmt, ##__VA_ARGS__)

That was written with my brain switched off
and was obviously incorrect.

> Hello Joe,

Hi Bart.

> Why do you think that would be better?

All of the messages save one already emit bd->name
(and that one that doesn't use bd->name could likely
use it too)

So maybe this is better:

#define bsg_dbg(bd, fmt, ...) \
pr_debug("%s: " fmt, (bd)->name, ##__VA_ARGS__)

cheers, Joe

\
 
 \ /
  Last update: 2018-01-22 22:04    [W:0.042 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site