lkml.org 
[lkml]   [2013]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] keucr: migrate printk to dev_dbg/info/warn/err
On Thu, Jun 06, 2013 at 02:23:08PM -0700, Joe Perches wrote:
> On Fri, 2013-06-07 at 00:11 +0300, Dan Carpenter wrote:
> > On Thu, Jun 06, 2013 at 10:53:20AM -0700, Joe Perches wrote:
> > > On Thu, 2013-06-06 at 18:10 +0200, Johannes Schilling wrote:
> > > > From: Laura Lawniczak <laura.lawniczak@googlemail.com>
> > > []
> > > > diff --git a/drivers/staging/keucr/init.c b/drivers/staging/keucr/init.c
> > > []
> > > > @@ -19,13 +19,13 @@ int ENE_InitMedia(struct us_data *us)
> > > []
> > > > - printk(KERN_INFO "MiscReg03 = %x\n", MiscReg03);
> > > > + dev_info(&us->pusb_dev->dev, "MiscReg03 = %x\n", MiscReg03);
> > >
> > > I suggest adding a few convenience macros to make
> > > this a bit shorter and more likely to fit on a single
> > > line without exceeding 80 cols.
> > >
> > > Adding something like:
> > >
> > > #define us_<level>(us, fmt, ...) \
> > > dev_<level>(&us->pusb_dev->dev, fmt, ##__VA_ARGS__)
> > >
> > > so these uses become
> > >
> > > us_info(us, "MiscReg03\n", MiscReg03);
> > >
> > > which is shorter and more readable.
> > >
> >
> > Wait what? That's not a readable example. Why are we passing the
> > MiscReg03 variable when there is no %d in the string?
>
> 'cause I forgot to add in the " = %x", Oops.

Ah, fine. In that case it's not an unreasonable macro.

I haven't looked at this closely enough to say for sure what option
is easiest or cleanest.

regards,
dan carpenter



\
 
 \ /
  Last update: 2013-06-07 00:21    [W:0.070 / U:27.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site