[2/3] tm6000: move debug info print from header into c file

Message ID 1275221944-27887-2-git-send-email-stefan.ringel@arcor.de (mailing list archive)
State Superseded, archived
Headers

Commit Message

Stefan Ringel May 30, 2010, 12:19 p.m. UTC
  From: Stefan Ringel <stefan.ringel@arcor.de>

move debug info print from header into c file

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
---
 drivers/staging/tm6000/tm6000-core.c  |    6 ++++++
 drivers/staging/tm6000/tm6000-dvb.c   |    8 ++++++++
 drivers/staging/tm6000/tm6000-video.c |    6 ++++++
 drivers/staging/tm6000/tm6000.h       |    7 -------
 4 files changed, 20 insertions(+), 7 deletions(-)
  

Comments

Mauro Carvalho Chehab June 2, 2010, 5:53 p.m. UTC | #1
Em 30-05-2010 09:19, stefan.ringel@arcor.de escreveu:
> From: Stefan Ringel <stefan.ringel@arcor.de>
> 
> move debug info print from header into c file

I don't see why to duplicate the printk's on every file. It seems better to me to
just keep them at the header file, and use tm6000_debug symbol for every tm6000
module.

Btw, I've applied a CodingStyle fix patch on my tree, together with the other patches.
As it touches on almost all drivers, it is better to merge from my tree ASAP.

I dunno why, but your rewrite copy_streams didn't apply fine, but this time I've fixed
the issues manually. I tested it here with two cards (Saphire Wonder TV - a 10moons clone,
based on tm5600 - and HVR900H), and the merge worked fine.

With your patch, image seems to be working fine (yet, I didn't re-add the memset(0) to
double check). However, running on a remote machine, via fast ethernet, the buffering
effect is seeing. Probably, there's still some trouble at the routine that fills the
buffers.

-

I suggest that you and Dmitri to use staging/tm6000 branch for development. this will
likely help to avoid conflict issues.

As usual, before submitting a patch, it would be wise to rebase it against upstream
with:
	git remote update
	git pull . staging/tm6000
	git rebase staging/tm6000

After doing it, please compile and test, before submitting me the patches.

Cheers,
Mauro.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c
index 624c276..b5965a8 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -29,6 +29,12 @@ 
 #include <media/v4l2-common.h>
 #include <media/tuner.h>
 
+#define dprintk(dev, level, fmt, arg...) do {			\
+	if (tm6000_debug & level)				\
+		printk(KERN_INFO "(%lu) %s %s :"fmt, jiffies,	\
+			dev->name, __FUNCTION__, ##arg);	\
+	} while (0)
+
 #define USB_TIMEOUT	5*HZ /* ms */
 
 int tm6000_read_write_usb (struct tm6000_core *dev, u8 req_type, u8 req,
diff --git a/drivers/staging/tm6000/tm6000-dvb.c b/drivers/staging/tm6000/tm6000-dvb.c
index 714b384..b9e9ef1 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -30,6 +30,14 @@ 
 #include "tuner-xc2028.h"
 #include "xc5000.h"
 
+#undef dprintk
+
+#define dprintk(dev, level, fmt, arg...) do {			\
+	if (debug >= level)					\
+		printk(KERN_INFO "(%lu) %s %s :"fmt, jiffies,	\
+			dev->name, __FUNCTION__, ##arg);	\
+	} while (0)
+
 static void inline print_err_status (struct tm6000_core *dev,
 				     int packet, int status)
 {
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c
index 9746fe7..98af4a5 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -42,6 +42,12 @@ 
 #include "tm6000-regs.h"
 #include "tm6000.h"
 
+#define dprintk(dev, level, fmt, arg...) do {			\
+	if (tm6000_debug & level)				\
+		printk(KERN_INFO "(%lu) %s %s :"fmt, jiffies,	\
+			dev->name, __FUNCTION__, ##arg);	\
+	} while (0)
+
 #define BUFFER_TIMEOUT     msecs_to_jiffies(2000)  /* 2 seconds */
 
 /* Limits minimum and default number of buffers */
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index 231e2be..fd94ed6 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -316,13 +316,6 @@  int tm6000_queue_init(struct tm6000_core *dev);
 
 /* Debug stuff */
 
-extern int tm6000_debug;
-
-#define dprintk(dev, level, fmt, arg...) do {\
-	if (tm6000_debug & level) \
-		printk(KERN_INFO "(%lu) %s %s :"fmt, jiffies, 		\
-			 dev->name, __FUNCTION__ , ##arg); } while (0)
-
 #define V4L2_DEBUG_REG		0x0004
 #define V4L2_DEBUG_I2C		0x0008
 #define V4L2_DEBUG_QUEUE	0x0010