Re: [PATCH] staging: ozwpan: Convert printk to dev_dbg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2013-06-25 at 17:30 +0100, Rupesh Gujare wrote:
> convert all debug messages from printk to dev_dbg() & add kernel config to
> enable/disable these messages during compilation.
[]
> -#define oz_trace(...) printk(TRACE_PREFIX __VA_ARGS__)
> +#define oz_trace(fmt, ...) dev_dbg(g_oz_wpan_dev, fmt, ##__VA_ARGS__);
>  #ifdef WANT_VERBOSE_TRACE
>  extern unsigned long trace_flags;
> -#define oz_trace2(_flag, ...) \
> -	do { if (trace_flags & _flag) printk(TRACE_PREFIX __VA_ARGS__); \
> +#define oz_trace2(_flag, fmt, ...) \
> +	do { if (trace_flags & _flag) \
> +		dev_dbg(g_oz_wpan_dev, fmt, ##__VA_ARGS__); \
>  	} while (0)

I think oz_trace is a poor name.
It implies you're using the trace subsystem
trace_flags as a global name is also poor
g_oz_wpan_dev is too as it limits the module to
a single dev instance.

I suggest:

#define oz_dbg(level, fmt, ...)					\
do {								\
	if (level & oz_dbg_mask)				\
		dev_dbg(g_oz_wpan_dev, fmt, ##__VA_ARGS__);	\
} while (0)

or better avoiding the single dev:

#define oz_dbg(level, dev, fmt, ...)				\
do {								\
	if (level & oz_dbg_mask)				\
		dev_dbg(dev, fmt, ##__VA_ARGS__);		\
} while (0)

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux