[PATCH] staging:comedi: Fixed coding convention issues.

Greg KH greg at kroah.com
Thu Jun 17 23:02:09 UTC 2010


On Mon, Jun 14, 2010 at 09:34:15AM +0300, Henri Häkkinen wrote:
> Cleaned up and fixed coding convention issues as reporteed by
> checkpatch.pl tool on the file `drivers.c'. Added logging macros
> to `comedidev.h'.  Replaced "BUG:" printk functions calls with
> BUG_ON macro.
> 
> Signed-off-by: Henri Häkkinen <henuxd at gmail.com>
> ---
>  drivers/staging/comedi/comedidev.h |   54 +++++++++++++++-
>  drivers/staging/comedi/drivers.c   |  118 +++++++++++++++--------------------
>  2 files changed, 102 insertions(+), 70 deletions(-)
> 
> diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
> index 4eb2b77..5c78564 100644
> --- a/drivers/staging/comedi/comedidev.h
> +++ b/drivers/staging/comedi/comedidev.h
> @@ -43,11 +43,59 @@
>  
>  #include "comedi.h"
>  
> -#define DPRINTK(format, args...)	do {		\
> -	if (comedi_debug)				\
> -		printk(KERN_DEBUG "comedi: " format , ## args);	\
> +#define comedi_printk(level, fmt, args...) \
> +	printk(level "comedi: " pr_fmt(fmt), ##args)
> +
> +#define DPRINTK(format, args...) \
> +do { \
> +	if (comedi_debug) \
> +		comedi_printk(KERN_DEBUG, fmt, ##args); \
>  } while (0)
>  
> +#define comedi_emerg(fmt, ...) \
> +	comedi_printk(KERN_EMERG, fmt, ##__VA_ARGS__)

I'd much rather you use the real dev_printk() versions of this instead
(dev_warn, dev_err, etc.) instead of creating a new macro.

thanks,

greg k-h



More information about the devel mailing list