aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2011-05-10 07:07:33 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-11 07:20:54 -0400
commit41b21aebe6a9c06e0b906f14bcab7c49b9b72d7a (patch)
treee8532c1a15e7d861497901318c79f89d1d3562c5 /drivers/video
parent0d548a277c8ce29712161995985bb67cd1c35ff7 (diff)
OMAP: DSS2: OMAPFB: make DBG() more resistant in if-else constructions
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 <ndevos@redhat.com> [tomi.valkeinen@ti.com: changed the title of the commit msg] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/omapfb/omapfb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 4d1cff97be1b..aa1b1d974276 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -34,8 +34,10 @@
34#ifdef DEBUG 34#ifdef DEBUG
35extern unsigned int omapfb_debug; 35extern unsigned int omapfb_debug;
36#define DBG(format, ...) \ 36#define DBG(format, ...) \
37 if (omapfb_debug) \ 37 do { \
38 printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__) 38 if (omapfb_debug) \
39 printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__); \
40 } while (0)
39#else 41#else
40#define DBG(format, ...) 42#define DBG(format, ...)
41#endif 43#endif