[openib-general] Re: [PATCHv2} ucm: Only print messages when debug level set

Muli Ben-Yehuda mulix at mulix.org
Wed Jul 13 13:43:46 PDT 2005


On Wed, Jul 13, 2005 at 11:29:33PM +0300, Michael S. Tsirkin wrote:
> Quoting r. Hal Rosenstock <halr at voltaire.com>:
> > @@ -56,6 +61,10 @@ enum {
> >  
> >  #define IB_UCM_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_MINOR)
> >  
> > +#define ucm_dbg(format, arg...)                 \
> > +	if (ucm_debug_level > 0)        \
> > +		printk(KERN_DEBUG format, ## arg)
> > +
> 
> What happened to whitespace here?
> Also, may it be a good idea for ucm_dbg to add the UCM: prefix
automatically?

You also want to wrap this thing up in a do { } while (0) loop (see
http://www.kernelnewbies.org/faq/, "Why do a lot of #defines in the
kernel use do { ... } while(0)?")

Cheers,
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/




More information about the general mailing list