[linux-dvb] [PATCH] mxl500x: Add module parameter to enable/disable debug messages

Nick Andrew nick-linuxtv at nick-andrew.net
Fri Apr 25 06:55:20 CEST 2008


On Thu, Apr 24, 2008 at 11:16:18PM -0400, Andy Walls wrote:
> +#define dprintk(level, fmt, arg...)                                       \
> +	do {                                                              \
> +		if (debug >= level)                                       \
> +			printk(KERN_DEBUG "%s: " fmt, "mxl500x", ## arg); \
> +	} while (0)

I think this code will be far more useful in kernel/printk.c rather
than every device driver and subsystem rolling their own (as seems to 
happen at this time).

Also see dev_dbg() and dev_printk() in include/linux/device.h.
What those macros are missing is what you have here - messages
printed or ignored depending on the value of a module variable
and/or parameter.

Nick.



More information about the linux-dvb mailing list