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>
This commit is contained in:
committed by
Tomi Valkeinen
parent
0d548a277c
commit
41b21aebe6
@@ -34,8 +34,10 @@
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
extern unsigned int omapfb_debug;
|
extern unsigned int omapfb_debug;
|
||||||
#define DBG(format, ...) \
|
#define DBG(format, ...) \
|
||||||
if (omapfb_debug) \
|
do { \
|
||||||
printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__)
|
if (omapfb_debug) \
|
||||||
|
printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define DBG(format, ...)
|
#define DBG(format, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user