[linux-dvb] Re: [PATCH] LGDT3302 Frontend Driver
Michael Krufky
mkrufky at m1k.net
Tue Jun 28 15:13:31 CEST 2005
Edgar Toernig wrote:
>Michael Krufky wrote:
>
>
>>>>+#define dprintk(args...) \
>>>>+do { \
>>>>+if (debug) printk(KERN_DEBUG "lgdt3302: " args); \
>>>>+} while (0)
>>>>
>>>>
>>>Yes but why do you need do {} while(0) stuff ?
>>>You don't need to declare a new block as you add only a if statement, so
>>>
>>>+#define dprintk(args...) if (debug) printk(KERN_DEBUG "lgdt3302: " args)
>>>
>>>will be a lot's of cleanner...
>>>
>>>
>>Agreed... I will add make that change.
>>
>>
>
>Better not. Code like this will brake horrible without the do-while:
>
> if (foo)
> dprintk(...);
> else
> bar();
>
>Ciao, ET.
>
>
Currently, I am using this:
#define dprintk(args...) { if (debug) printk(KERN_DEBUG "lgdt3302: "
args); }
...and it compiles cleanly. I must drive to the office now, I will hold
off on the commit until I get there, to give you a chance to reply to
this email :-)
--
Michael Krufky
More information about the linux-dvb
mailing list