diff options
author | Niels de Vos <ndevos@redhat.com> | 2011-06-22 20:39:08 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-06-22 20:39:08 +0100 |
commit | c7073fb2d2d137c2a5641eda1a848e9238962a57 (patch) | |
tree | 5c220cd849fa59e6143225ca6eb1441a06f53655 | |
parent | 98f46c3d4428fab939df504e3abe866140000762 (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>
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h index 4d1cff97be1..aa1b1d97427 100644 --- a/drivers/video/omap2/omapfb/omapfb.h +++ b/drivers/video/omap2/omapfb/omapfb.h @@ -34,8 +34,10 @@ #ifdef DEBUG extern unsigned int omapfb_debug; #define DBG(format, ...) \ - if (omapfb_debug) \ - printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__) + do { \ + if (omapfb_debug) \ + printk(KERN_DEBUG "OMAPFB: " format, ## __VA_ARGS__); \ + } while (0) #else #define DBG(format, ...) #endif |