Skip to contentSkip to conversation

2.6.0-test7: saa7134 breaks on gcc 2.95

PATCH Eyal Lebedinsky 3 participants 4 messages Oct 15, 2003 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

This compiler does not like dangling comma in funcs, so this patch is needed. For:

#define dprintk(fmt, arg...)    if (core_debug) \
	printk(KERN_DEBUG "%s/core: " fmt, dev->name, ## arg)

Lines like this:

	dprintk("hwinit1\n");

should be hacked like this:

	dprintk("hwinit1\n", "");

Or maybe someone knows a better solution.

--
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>

drivers/media/video/saa7134/saa7134-core.c renamed from drivers/media/video/saa7134/saa7134-core.c.orig +3 -3
@@ -624,7 +624,7 @@
 /* early init (no i2c, no irq) */
 static int saa7134_hwinit1(struct saa7134_dev *dev)
 {
-	dprintk("hwinit1\n");
+	dprintk("hwinit1\n", "");
 
 	saa_writel(SAA7134_IRQ1, 0);
 	saa_writel(SAA7134_IRQ2, 0);
@@ -675,7 +675,7 @@
 /* late init (with i2c + irq) */
 static int saa7134_hwinit2(struct saa7134_dev *dev)
 {
-	dprintk("hwinit2\n");
+	dprintk("hwinit2\n", "");
 
 	saa7134_video_init2(dev);
 	saa7134_tvaudio_init2(dev);
@@ -703,7 +703,7 @@
 /* shutdown */
 static int saa7134_hwfini(struct saa7134_dev *dev)
 {
-	dprintk("hwfini\n");
+	dprintk("hwfini\n", "");
 
 	switch (dev->pci->device) {
 	case PCI_DEVICE_ID_PHILIPS_SAA7134:
#1 lore raw
Quoted 5 lines · Eyal Lebedinsky

This compiler does not like dangling comma in funcs, so this patch
is needed. For:

#define dprintk(fmt, arg...) if (core_debug) \

Review

Quoted 9 lines
(quoted diff) +0 -0
 	printk(KERN_DEBUG "%s/core: " fmt, dev->name, ## arg)
 
 Lines like this:
 
 	dprintk("hwinit1\n");
 
 should be hacked like this:
 
 	dprintk("hwinit1\n", "");

I couldn't find a sane way. Ended up doing this:

drivers/media/video/saa7134/saa7134-core.c renamed from drivers/media/video/saa7134/saa7134-core.c~saa7134-build-fix +7 -2
diff -puN drivers/media/video/saa7134/saa7134-core.c~saa7134-build-fix drivers/media/video/saa7134/saa7134-core.c
@@ -94,8 +94,13 @@ MODULE_PARM_DESC(latency,"pci latency ti
 struct list_head  saa7134_devlist;
 unsigned int      saa7134_devcount;
 
-#define dprintk(fmt, arg...)	if (core_debug) \
-	printk(KERN_DEBUG "%s/core: " fmt, dev->name, ## arg)
+#define dprintk(fmt, arg...)						\
+	do {								\
+		if (core_debug) {					\
+			printk(KERN_DEBUG "%s/core: ", dev->name);	\
+			printk(fmt, ## arg);				\
+		}							\
+	} while (0)
 
 /* ------------------------------------------------------------------ */
 /* debug help functions                                               */

_

#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 8 lines · Eyal Lebedinsky

This compiler does not like dangling comma in funcs, so this patch
is needed. For:

#define dprintk(fmt, arg...) if (core_debug) \
printk(KERN_DEBUG "%s/core: " fmt, dev->name, ## arg)

Lines like this:

Quoted 7 lines

Review

Quoted 5 lines
(quoted diff) +0 -0
 	dprintk("hwinit1\n");
 
 should be hacked like this:
 
 	dprintk("hwinit1\n", "");

I couldn't find a sane way. Ended up doing this:

[splitting the printk]

GCC 2.95 doesn't like no space BEFORE AND AFTER the comma in the argument right before the "## arg".

So just having a space there should work without splitting the printk. Not compile tested, since I need to go now.

Regards

Ingo Oeser

#3 lore raw
Quoted 3 lines · Ingo Oeser

GCC 2.95 doesn't like no space BEFORE AND AFTER the comma in the argument right
before the "## arg".

Yup.

drivers/media/video/saa7134/saa7134-core.c renamed from drivers/media/video/saa7134/saa7134-core.c~a +1 -1
@@ -95,7 +95,7 @@ struct list_head  saa7134_devlist;
 unsigned int      saa7134_devcount;
 
 #define dprintk(fmt, arg...)	if (core_debug) \
-	printk(KERN_DEBUG "%s/core: " fmt, dev->name, ## arg)
+	printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
 
 /* ------------------------------------------------------------------ */
 /* debug help functions                                               */

_