Re: [PATCH rdma-core 08/10] i40iw: Control debug error prints using env variable

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

 



On Thu, Dec 08, 2016 at 11:22:25AM -0700, Jason Gunthorpe wrote:
> On Thu, Dec 08, 2016 at 12:16:39PM -0600, Tatyana Nikolova wrote:
> 
> > +extern unsigned int i40iw_dbg;
> > +#define i40iw_debug(fmt, args...) \
> > +	if (i40iw_dbg) \
> > +		fprintf(stderr, PFX "%s: " fmt, __FUNCTION__, ##args)
> > +
> 
> No, this is an unsafe way to use defines, wrap it in do / while (0)
> 
> I would also welcome providing general infrastructure for this  -
> every drvier seems to have this same basic approach.

+1,
The amount of copypasta in rdma-core drives me crazy.

> 
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux