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

Hal Rosenstock halr at voltaire.com
Wed Jul 13 16:24:48 PDT 2005


On Wed, 2005-07-13 at 16:43, Muli Ben-Yehuda wrote:
> 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)?")

Thanks. I'll do that in my next version of the patch.

-- Hal




More information about the general mailing list