From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from [66.180.172.116] (helo=vps1.tull.net) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1JpFyS-0002c3-CV for linux-dvb@linuxtv.org; Fri, 25 Apr 2008 06:55:53 +0200 Date: Fri, 25 Apr 2008 14:55:20 +1000 From: Nick Andrew To: Andy Walls Message-ID: <20080425045520.GA17371@tull.net> References: <1209093378.6367.22.camel@palomino.walls.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1209093378.6367.22.camel@palomino.walls.org> Cc: linux-dvb@linuxtv.org, ivtv-devel@ivtvdriver.org Subject: Re: [linux-dvb] [PATCH] mxl500x: Add module parameter to enable/disable debug messages List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linux-dvb-bounces@linuxtv.org Errors-To: linux-dvb-bounces+mchehab=infradead.org@linuxtv.org List-ID: 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. _______________________________________________ linux-dvb mailing list linux-dvb@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb