[PATCH] Staging: Comedi: Drivers: Fix coding style issues in dt2801.c

Joe Perches joe at perches.com
Thu Apr 22 04:00:11 UTC 2010


On Wed, 2010-04-21 at 22:46 -0500, Gustavo Silva wrote:
>  drivers/staging/comedi/drivers/dt2801.c |  100 ++++++++++++++-----------------
>  1 files changed, 44 insertions(+), 56 deletions(-)

Hi Gustavo.  A couple of trivial comments.

> diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c
> index 3f365ae..c4408d8 100644
> --- a/drivers/staging/comedi/drivers/dt2801.c
> +++ b/drivers/staging/comedi/drivers/dt2801.c
> @@ -102,58 +102,46 @@ COMEDI_INITCLEANUP(driver_dt2801);
>  
>  #if 0

You could just as well remove the #if 0 blocks

> @@ -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.

cheers, Joe




More information about the devel mailing list