On Sat, Jun 12, 2010 at 10:30:50PM -0700, Joe Perches wrote:
> On Sat, 2010-06-12 at 22:07 -0700, Joe Perches wrote:
> > 2: Create some comedi logging functions or macros like:
> >     comedi_<level>(fmt, arg...) (ie: comedi_info, comedi_err, etc)
> >    where "comedi:" is always prefixed and an
> >    optional #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >    could be used.
> 
> Maybe this is a start:
> 
> Signed-off-by: Joe Perches <[email protected]>
> ---
>  drivers/staging/comedi/comedidev.h |   54 
> ++++++++++++++++++++++++++++++++++--
>  1 files changed, 51 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/comedi/comedidev.h 
> b/drivers/staging/comedi/comedidev.h
> index 4eb2b77..6c2bdde 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 would prefer the conversion of everything over to the dev_printk()
versions instead of creating a new macro for every individual subsystem.
That way you get the advantage of logging everything in the common
format and the dynamic debug functionality as well.

thanks,

greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to