[media] saa7134: avoid complex macro warnings
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 13 May 2015 17:09:25 +0000 (14:09 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 13 May 2015 17:12:05 +0000 (14:12 -0300)
The debug macros are not properly defined, as they generate warnings
like:

ERROR: Macros with complex values should be enclosed in parentheses
+#define core_dbg(fmt, arg...)    if (core_debug) \
+ printk(KERN_DEBUG pr_fmt("core: " fmt), ## arg)

Use do { } while (0) for those macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/saa7134/saa7134-core.c
drivers/media/pci/saa7134/saa7134-i2c.c
drivers/media/pci/saa7134/saa7134-input.c
drivers/media/pci/saa7134/saa7134-ts.c
drivers/media/pci/saa7134/saa7134-tvaudio.c
drivers/media/pci/saa7134/saa7134-vbi.c
drivers/media/pci/saa7134/saa7134-video.c

index e88e4ec8c0ee6f197c480138846d0ce6048acee7..02a08770507d50d9218861e5725631c98dcdb2bc 100644 (file)
@@ -102,11 +102,15 @@ static unsigned int saa7134_devcount;
 int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
 int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
 
-#define core_dbg(fmt, arg...)    if (core_debug) \
-       printk(KERN_DEBUG pr_fmt("core: " fmt), ## arg)
-
-#define irq_dbg(level, fmt, arg...)    if (irq_debug > level) \
-       printk(KERN_DEBUG pr_fmt("irq: " fmt), ## arg)
+#define core_dbg(fmt, arg...) do { \
+       if (core_debug) \
+               printk(KERN_DEBUG pr_fmt("core: " fmt), ## arg); \
+       } while (0)
+
+#define irq_dbg(level, fmt, arg...)  do {\
+       if (irq_debug > level) \
+               printk(KERN_DEBUG pr_fmt("irq: " fmt), ## arg); \
+       } while (0)
 
 void saa7134_track_gpio(struct saa7134_dev *dev, char *msg)
 {
index d04fbdb491584a7e6604c42efb562b1b2f71258a..b90434b41efe29f8bc47cc27c88b3e9a669ed19d 100644 (file)
@@ -41,11 +41,15 @@ static unsigned int i2c_scan;
 module_param(i2c_scan, int, 0444);
 MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time");
 
-#define i2c_dbg(level, fmt, arg...)    if (i2c_debug == level) \
-       printk(KERN_DEBUG pr_fmt("i2c: " fmt), ## arg)
-
-#define i2c_cont(level, fmt, arg...)    if (i2c_debug == level) \
-       pr_cont(fmt, ## arg)
+#define i2c_dbg(level, fmt, arg...) do { \
+       if (i2c_debug == level) \
+               printk(KERN_DEBUG pr_fmt("i2c: " fmt), ## arg); \
+       } while (0)
+
+#define i2c_cont(level, fmt, arg...) do { \
+       if (i2c_debug == level) \
+               pr_cont(fmt, ## arg); \
+       } while (0)
 
 #define I2C_WAIT_DELAY  32
 #define I2C_WAIT_RETRY  16
index c6036557b46849a83191eb2b49c4031d879659b3..e92bcfe9bbcb6d324dd72e7dd645350205945340 100644 (file)
@@ -41,10 +41,14 @@ static int pinnacle_remote;
 module_param(pinnacle_remote, int, 0644);    /* Choose Pinnacle PCTV remote */
 MODULE_PARM_DESC(pinnacle_remote, "Specify Pinnacle PCTV remote: 0=coloured, 1=grey (defaults to 0)");
 
-#define input_dbg(fmt, arg...) if (ir_debug) \
-       printk(KERN_DEBUG pr_fmt("input: " fmt), ## arg)
-#define ir_dbg(ir, fmt, arg...)    if (ir_debug) \
-       printk(KERN_DEBUG pr_fmt("ir %s: " fmt), ir->name, ## arg)
+#define input_dbg(fmt, arg...) do { \
+       if (ir_debug) \
+               printk(KERN_DEBUG pr_fmt("input: " fmt), ## arg); \
+       } while (0)
+#define ir_dbg(ir, fmt, arg...) do { \
+       if (ir_debug) \
+               printk(KERN_DEBUG pr_fmt("ir %s: " fmt), ir->name, ## arg); \
+       } while (0)
 
 /* Helper function for raw decoding at GPIO16 or GPIO18 */
 static int saa7134_raw_decode_irq(struct saa7134_dev *dev);
index 5d7c4afac8e6ab36d877079be0fa608ead1908f9..07ca32f1b6d92b65ae001b46fe2c2c89c6fa532e 100644 (file)
@@ -35,8 +35,10 @@ static unsigned int ts_debug;
 module_param(ts_debug, int, 0644);
 MODULE_PARM_DESC(ts_debug,"enable debug messages [ts]");
 
-#define ts_dbg(fmt, arg...)    if (ts_debug) \
-       printk(KERN_DEBUG pr_fmt("ts: " fmt), ## arg)
+#define ts_dbg(fmt, arg...) do { \
+       if (ts_debug) \
+               printk(KERN_DEBUG pr_fmt("ts: " fmt), ## arg); \
+       } while (0)
 
 /* ------------------------------------------------------------------ */
 static int buffer_activate(struct saa7134_dev *dev,
index 6320b64d3528f2583f322f373063903481ef2489..1a960a1b07b530b98255156a1cb07f4480e7fe6e 100644 (file)
@@ -49,8 +49,10 @@ static int audio_clock_tweak;
 module_param(audio_clock_tweak, int, 0644);
 MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with audio crystal that's slightly off (range [-1024 .. 1024])");
 
-#define audio_dbg(level, fmt, arg...)    if (audio_debug >= level) \
-       printk(KERN_DEBUG pr_fmt("audio: " fmt), ## arg)
+#define audio_dbg(level, fmt, arg...) do { \
+       if (audio_debug >= level) \
+               printk(KERN_DEBUG pr_fmt("audio: " fmt), ## arg); \
+       } while (0)
 
 /* msecs */
 #define SCAN_INITIAL_DELAY     1000
index face07bf420de69be7c8bb8d804e76927397f4f2..4d36586ad752bd48159fcdfa6d2480eadb4844db 100644 (file)
@@ -38,8 +38,10 @@ static unsigned int vbibufs = 4;
 module_param(vbibufs, int, 0444);
 MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32");
 
-#define vbi_dbg(fmt, arg...)   if (vbi_debug) \
-       printk(KERN_DEBUG pr_fmt("vbi: " fmt), ## arg)
+#define vbi_dbg(fmt, arg...) do { \
+       if (vbi_debug) \
+               printk(KERN_DEBUG pr_fmt("vbi: " fmt), ## arg); \
+       } while (0)
 
 /* ------------------------------------------------------------------ */
 
index 525ae6837fb3b8af5b147c776b76fe1528eec42d..f874b0c9fe4aebc4f2253dc1cb9656c40c32b797 100644 (file)
@@ -52,8 +52,10 @@ module_param_string(secam, secam, sizeof(secam), 0644);
 MODULE_PARM_DESC(secam, "force SECAM variant, either DK,L or Lc");
 
 
-#define video_dbg(fmt, arg...) if (video_debug & 0x04) \
-       printk(KERN_DEBUG pr_fmt("video: " fmt), ## arg)
+#define video_dbg(fmt, arg...) do { \
+       if (video_debug & 0x04) \
+               printk(KERN_DEBUG pr_fmt("video: " fmt), ## arg); \
+       } while (0)
 
 /* ------------------------------------------------------------------ */
 /* Defines for Video Output Port Register at address 0x191            */
This page took 0.087848 seconds and 5 git commands to generate.