Re: [PATCH] Staging: Comedi: Drivers: Fix coding style issues indt2801.c

From: Wolfram Sang
Date: Thu Apr 22 2010 - 00:13:47 EST


On Wed, Apr 21, 2010 at 09:00:11PM -0700, Joe Perches wrote:

> > @@ -374,8 +362,8 @@ static int dt2801_writecmd(struct comedi_device *dev, int command)
> >
> > stat = inb_p(dev->iobase + DT2801_STATUS);
> > if (stat & DT_S_COMPOSITE_ERROR) {
> > - printk
> > - ("dt2801: composite-error in dt2801_writecmd(), ignoring\n");
> > + printk(KERN_INFO "dt2801: composite-error in dt2801_writecmd()"
> > + ", ignoring\n");
>
> It's good to preface with KERN_, but better might be to use
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> and strip the "dt2801: " intro and use
> pr_<level>("%s(): composite-error, ignoring\n", __func__)
>
> It's a bit shorter, always gets the appropriate prefix, and
> would emit the proper function name if ever refactored.

What about dev_* in case there are more than one of those devices?
Also, KERN_INFO doesn't look right, KERN_WARN?

--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |

Attachment: signature.asc
Description: Digital signature