Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45f38cb3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] saa7134: avoid complex macro warnings



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: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 2bb3e2ee
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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)
{
+9 −5
Original line number Diff line number Diff line
@@ -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
+8 −4
Original line number Diff line number Diff line
@@ -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);
+4 −2
Original line number Diff line number Diff line
@@ -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,
+4 −2
Original line number Diff line number Diff line
@@ -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
Loading