Skip to contentSkip to conversation

Patch: Rename vprintk define in bttpvp.h

PATCH Bernd Petrovitsch 1 participant 2 messages Sep 21, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The attached patched againt 2.6.13 renames the (apparently) bttv intern #define vprintk to verbprintk to resolve a name clash.

Reason: vprintk() is defined in include/linux/kernel.h similar to printk but with a va_list argument.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
include/asm-i386/spinlock.h +0 -3
diff -uprN -X linux-2.6.13/Documentation/dontdiff linux-2.6.13/include/asm-i386/spinlock.h linux-2.6.13-patched/include/asm-i386/spinlock.h
@@ -7,9 +7,6 @@
 #include <linux/config.h>
 #include <linux/compiler.h>
 
-asmlinkage int printk(const char * fmt, ...)
-	__attribute__ ((format (printf, 1, 2)));
-
 /*
  * Your basic SMP spinlocks, allowing only a single CPU anywhere
  */
include/linux/kernel.h +2 -6
diff -uprN -X linux-2.6.13/Documentation/dontdiff linux-2.6.13/include/linux/kernel.h linux-2.6.13-patched/include/linux/kernel.h
@@ -129,12 +129,8 @@ asmlinkage int vprintk(const char *fmt, 
 asmlinkage int printk(const char * fmt, ...)
 	__attribute__ ((format (printf, 1, 2)));
 #else
-static inline int vprintk(const char *s, va_list args)
-	__attribute__ ((format (printf, 1, 0)));
-static inline int vprintk(const char *s, va_list args) { return 0; }
-static inline int printk(const char *s, ...)
-	__attribute__ ((format (printf, 1, 2)));
-static inline int printk(const char *s, ...) { return 0; }
+#define vprintk(fmt, args)      ((void)(fmt, args), 0)
+#define printk(...)             (__VA_ARGS__, 0)
 #endif
 
 unsigned long int_sqrt(unsigned long);
Makefile +1 -1
diff -uprN -X linux-2.6.13/Documentation/dontdiff linux-2.6.13/Makefile linux-2.6.13-patched/Makefile
@@ -350,7 +350,7 @@ CPPFLAGS        := -D__KERNEL__ $(LINUXI
 
 CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs \
 	  	   -fno-strict-aliasing -fno-common \
-		   -ffreestanding
+		   -ffreestanding -Wno-unused-value
 AFLAGS		:= -D__ASSEMBLY__
 
 export	VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \
#1 lore raw
Quoted 5 lines · Bernd Petrovitsch

The attached patched againt 2.6.13 renames the (apparently) bttv intern #define vprintk to verbprintk to resolve a name clash.

Reason: vprintk() is defined in include/linux/kernel.h similar to printk but with a va_list argument.

Sorry for the noise, -EWRONGPATCH. Now with the correct one.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
drivers/media/video/bttv-driver.c +7 -7
diff -uprN -X linux-2.6.13/Documentation/dontdiff linux-2.6.13/drivers/media/video/bttv-driver.c linux-2.6.13-patched/drivers/media/video/bttv-driver.c
@@ -761,21 +761,21 @@ static void set_pll(struct bttv *btv)
                 /* no PLL needed */
                 if (btv->pll.pll_current == 0)
                         return;
-		vprintk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n",
-			btv->c.nr,btv->pll.pll_ifreq);
+		verbprintk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n",
+                           btv->c.nr,btv->pll.pll_ifreq);
                 btwrite(0x00,BT848_TGCTRL);
                 btwrite(0x00,BT848_PLL_XCI);
                 btv->pll.pll_current = 0;
                 return;
         }
 
-	vprintk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr,
-		btv->pll.pll_ifreq, btv->pll.pll_ofreq);
+	verbprintk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr,
+                   btv->pll.pll_ifreq, btv->pll.pll_ofreq);
 	set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq);
 
         for (i=0; i<10; i++) {
 		/*  Let other people run while the PLL stabilizes */
-		vprintk(".");
+		verbprintk(".");
 		msleep(10);
 
                 if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) {
@@ -783,12 +783,12 @@ static void set_pll(struct bttv *btv)
                 } else {
                         btwrite(0x08,BT848_TGCTRL);
                         btv->pll.pll_current = btv->pll.pll_ofreq;
-			vprintk(" ok\n");
+			verbprintk(" ok\n");
                         return;
                 }
         }
         btv->pll.pll_current = -1;
-	vprintk("failed\n");
+	verbprintk("failed\n");
         return;
 }
 
drivers/media/video/bttvp.h +1 -1
diff -uprN -X linux-2.6.13/Documentation/dontdiff linux-2.6.13/drivers/media/video/bttvp.h linux-2.6.13-patched/drivers/media/video/bttvp.h
@@ -222,7 +222,7 @@ extern void bttv_gpio_tracking(struct bt
 extern int init_bttv_i2c(struct bttv *btv);
 extern int fini_bttv_i2c(struct bttv *btv);
 
-#define vprintk  if (bttv_verbose) printk
+#define verbprintk if (bttv_verbose) printk
 #define dprintk  if (bttv_debug >= 1) printk
 #define d2printk if (bttv_debug >= 2) printk