Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 89877e42827f16fa5f86b1df0c2860b1 > files > 2377

kernel-2.6.18-128.1.10.el5.src.rpm

From: Mauro Carvalho Chehab <mchehab@redhat.com>
Date: Mon, 11 Aug 2008 21:37:57 -0300
Subject: [video] make V4L2 less verbose
Message-id: 20080811213757.5ca85462@gaivota.chehab.org
O-Subject: [RHEL5 PATCH] Make V4L2 less verbose
Bugzilla: 455230
RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com>
RH-Acked-by: Jarod Wilson <jwilson@redhat.com>
RH-Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=455230

RHEL5 videodev module is too verbose on V4L2 ioctl debug messages, due to a bug
at dbgarg/dbgarg2.

This patch backports the changes on dbgarg and dbgarg2 made upstream by
changeset: 21575c13125f2ef790e192e2c70e446c6cfe0d7d

Those debug macros used to be at videodev.c (currently, those macros were moved
on upstream to v4l2-ioctl.c, on git changeset 35ea11ff84719b1bfab2909903a9640a86552fd1).

This patch were tested by enabling vivi module and testing with tvtime, on RHEL 5.2.

Before this patch, a software using mmapped buffers were generating about 50 or
60 dmesg's per second, depending on the video standard.

It should be noticed that this bug doesn't currently affect any compiled
driver on RHEL5, since the only driver that uses those debug macros on kernel
2.6.18 is vivi, that is not compiled by default. However, this bug does affect
out-of-tree drivers that would use videodev.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 2299e29..fedf982 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -17,14 +17,19 @@
  */
 
 #define dbgarg(cmd, fmt, arg...) \
-		if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)			\
-			printk (KERN_DEBUG "%s: ",  vfd->name);		\
+		do {							\
+		    if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) {		\
+			printk(KERN_DEBUG "%s: ",  vfd->name);		\
 			v4l_printk_ioctl(cmd);				\
-			printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg);
+			printk(" " fmt,  ## arg);			\
+		    }							\
+		} while (0)
 
 #define dbgarg2(fmt, arg...) \
-		if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)			\
-			printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg);
+		do {							\
+		    if (vfd->debug & V4L2_DEBUG_IOCTL_ARG)		\
+			printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\
+		} while (0)
 
 #include <linux/module.h>
 #include <linux/types.h>