Skip to contentSkip to conversation

staging: line6: replace CONFIG_LINE6_USB_DEBUG with dyndbg

PATCH In review Stefan Hajnoczi 2 participants 6 messages Nov 11, 2012 – Nov 14, 2012 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: line6: replace CONFIG_LINE6_USB_DEBUG with dyndbg

Daniel Mack <[email protected]> suggested the dyndbg mechanism which allows dev_dbg() messages to be enabled/disabled at run-time. This is more powerful than the compile-time CONFIG_LINE6_USB_DEBUG option.

This patch series converts debug messages to dev_dbg() and drops the obsolete CONFIG_LINE6_USB_DEBUG option.

Stefan Hajnoczi (3):
staging: line6: replace DEBUG_MESSAGES() with dev_dbg()
staging: line6: drop unused DEBUG_MESSAGES() macro
staging: line6: drop unused CONFIG_LINE6_USB_DEBUG

 drivers/staging/line6/Kconfig  |  8 ------
 drivers/staging/line6/driver.c |  6 ++---
 drivers/staging/line6/driver.h |  6 -----
 drivers/staging/line6/pod.c    | 57 ++++++++++++++++--------------------------
 drivers/staging/line6/variax.c | 12 ++++-----
 5 files changed, 28 insertions(+), 61 deletions(-)
Signature · 1 line
1.7.12.1
#1 lore raw

PATCH 1/3 staging: line6: replace DEBUG_MESSAGES() with dev_dbg()

The dyndbg feature allows dev_dbg() calls to be enabled/disabled at runtime and is therefore more convenient than static debug log messages. Use dev_dbg() instead of the line6-specific DEBUG_MESSAGES() macro.

---
 drivers/staging/line6/driver.c |  6 ++---
 drivers/staging/line6/pod.c    | 57 ++++++++++++++++--------------------------
 drivers/staging/line6/variax.c | 12 ++++-----
 3 files changed, 28 insertions(+), 47 deletions(-)
drivers/staging/line6/driver.c +2 -4
index ac11a3b..571f2ce 100644
@@ -412,10 +412,8 @@ static void line6_data_received(struct urb *urb)
 
 	if (done < urb->actual_length) {
 		line6_midibuf_ignore(mb, done);
-		DEBUG_MESSAGES(dev_err
-			       (line6->ifcdev,
-				"%d %d buffer overflow - message skipped\n",
-				done, urb->actual_length));
+		dev_dbg(line6->ifcdev, "%d %d buffer overflow - message skipped\n",
+			done, urb->actual_length);
 	}
 
 	for (;;) {
drivers/staging/line6/pod.c +21 -36

100 lines not on this page · raw message

drivers/staging/line6/variax.c +5 -7
index 1b85ecc..8df529f 100644
@@ -262,10 +262,9 @@ void line6_variax_process_message(struct usb_line6_variax *variax)
 					     2, VARIAX_DUMP_PASS3);
 				}
 			} else {
-				DEBUG_MESSAGES(dev_err
-					       (variax->line6.ifcdev,
-						"illegal length %d of model data\n",
-						variax->line6.message_length));
+				dev_dbg(variax->line6.ifcdev,
+					"illegal length %d of model data\n",
+					variax->line6.message_length);
 				line6_dump_finished(&variax->dumpreq);
 			}
 		} else if (memcmp(buf + 1, variax_request_bank + 1,
@@ -295,9 +294,8 @@ void line6_variax_process_message(struct usb_line6_variax *variax)
 		break;
 
 	default:
-		DEBUG_MESSAGES(dev_err
-			       (variax->line6.ifcdev,
-				"Variax: unknown message %02X\n", buf[0]));
+		dev_dbg(variax->line6.ifcdev,
+			"Variax: unknown message %02X\n", buf[0]);
 	}
 }
 
Signature · 1 line
1.7.12.1
#2 lore raw

Re: [PATCH 1/3] staging: line6: replace DEBUG_MESSAGES() with dev_dbg()

drivers/staging/line6/pod.c void line6_pod_process_message(struct usb_line6_pod *pod) · line 267

Quoted 5 lines · Stefan Hajnoczi
drivers/staging/line6/pod.c +5 -0
+					dev_dbg(pod->line6.ifcdev,
+						"wrong size of channel dump message (%d instead of %d)\n",
+						pod->line6.message_length,
+						(int)sizeof(pod->prog_data) +
+						7);

Better to get rid of the cast. You're already over the 80 character limit so putting the "7);" on the line before is ok.

regards,
dan carpenter

#3 lore raw

PATCH 2/3 staging: line6: drop unused DEBUG_MESSAGES() macro

In reply to Stefan Hajnoczi

The DEBUG_MESSAGES() macro is no longer needed since dev_dbg() is now used for debug messages.

---
 drivers/staging/line6/driver.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/line6/driver.h +0 -6
index 35246cf..9dd8ff4 100644
@@ -52,12 +52,6 @@
 
 #define LINE6_CHANNEL_MASK 0x0f
 
-#ifdef CONFIG_LINE6_USB_DEBUG
-#define DEBUG_MESSAGES(x) (x)
-#else
-#define DEBUG_MESSAGES(x)
-#endif
-
 #define MISSING_CASE	\
 	printk(KERN_ERR "line6usb driver bug: missing case in %s:%d\n", \
 		__FILE__, __LINE__)
Signature · 1 line
1.7.12.1
#4 lore raw

PATCH 3/3 staging: line6: drop unused CONFIG_LINE6_USB_DEBUG

In reply to Stefan Hajnoczi

The CONFIG_LINE6_USB_DEBUG option is no longer relevant since dyndbg dev_dbg() is now used instead of a compile-time decision whether to enable debug messages or not.

---
 drivers/staging/line6/Kconfig | 8 --------
 1 file changed, 8 deletions(-)
drivers/staging/line6/Kconfig +0 -8
index 43120ff..a5ded12 100644
@@ -23,14 +23,6 @@ menuconfig LINE6_USB
 
 if LINE6_USB
 
-config LINE6_USB_DEBUG
-	bool "print debug messages"
-	default n
-	help
-	  Say Y here to write debug messages to the syslog.
-
-	  If unsure, say N.
-
 config LINE6_USB_DUMP_CTRL
 	bool "dump control messages"
 	default n
Signature · 1 line
1.7.12.1
#5 lore raw
In reply to Stefan Hajnoczi
Quoted 12 lines · Stefan Hajnoczi

Daniel Mack <[email protected]> suggested the dyndbg mechanism which allows dev_dbg() messages to be enabled/disabled at run-time. This is more powerful than the compile-time CONFIG_LINE6_USB_DEBUG option.

This patch series converts debug messages to dev_dbg() and drops the obsolete CONFIG_LINE6_USB_DEBUG option.

Stefan Hajnoczi (3):
staging: line6: replace DEBUG_MESSAGES() with dev_dbg()
staging: line6: drop unused DEBUG_MESSAGES() macro
staging: line6: drop unused CONFIG_LINE6_USB_DEBUG

Quoted 6 lines
 drivers/staging/line6/Kconfig  |  8 ------
 drivers/staging/line6/driver.c |  6 ++---
 drivers/staging/line6/driver.h |  6 -----
 drivers/staging/line6/pod.c    | 57 ++++++++++++++++--------------------------
 drivers/staging/line6/variax.c | 12 ++++-----
 5 files changed, 28 insertions(+), 61 deletions(-)

I forgot to mention these patches apply on top of the "staging: line6:
checkpatch.pl cleanups" series I sent earlier today.

Stefan