RE: [PATCH] omap2/omapfb: make DBG() more resistant in if-else constructions

2011-05-10 Thread Premi, Sanjeev
-Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Niels de Vos Sent: Tuesday, May 10, 2011 2:51 PM To: linux-omap@vger.kernel.org Cc: linux-fb...@vger.kernel.org; linux-ker...@vger.kernel.org; Niels de Vos Subject:

Re: [PATCH] omap2/omapfb: make DBG() more resistant in if-else constructions

2011-05-10 Thread Geert Uytterhoeven
On Tue, May 10, 2011 at 11:20, Niels de Vos nde...@redhat.com wrote: When DBG() is used in a simple if-else, the resulting code path currently depends on the definition of DBG(). Inserting the statement in a do { ... } while (0) prevents this possible misuse. Signed-off-by: Niels de Vos

Re: [PATCH] omap2/omapfb: make DBG() more resistant in if-else constructions

2011-05-10 Thread Niels de Vos
On Tue, May 10, 2011 at 10:42 AM, Geert Uytterhoeven ge...@linux-m68k.org wrote: On Tue, May 10, 2011 at 11:20, Niels de Vos nde...@redhat.com wrote: When DBG() is used in a simple if-else, the resulting code path currently depends on the definition of DBG(). Inserting the statement in a do {

Re: [PATCH] omap2/omapfb: make DBG() more resistant in if-else constructions

2011-05-10 Thread Tomi Valkeinen
On Tue, 2011-05-10 at 11:42 +0200, Geert Uytterhoeven wrote: What about using the standard pr_debug()/dev_dbg() instead? With dynamic debug, it can be enabled at run time. As a bonus, you get printf()-style format checking if debugging is disabled. Yes, dev_dbg co. would be better. However,

Re: [PATCH] omap2/omapfb: make DBG() more resistant in if-else constructions

2011-05-10 Thread Geert Uytterhoeven
On Tue, May 10, 2011 at 14:08, Tomi Valkeinen tomi.valkei...@ti.com wrote: On Tue, 2011-05-10 at 11:42 +0200, Geert Uytterhoeven wrote: What about using the standard pr_debug()/dev_dbg() instead? With dynamic debug, it can be enabled at run time. As a bonus, you get printf()-style format