Thread: [Line6linux-devel] [PATCH 0/3] staging: line6: replace CONFIG_LINE6_USB_DEBUG with dyndbg
Status: Pre-Alpha
Brought to you by:
mgrabner
From: Stefan H. <ste...@gm...> - 2012-11-11 12:52:50
|
Daniel Mack <zo...@gm...> 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(-) -- 1.7.12.1 |
From: Stefan H. <ste...@gm...> - 2012-11-11 12:52:54
|
The DEBUG_MESSAGES() macro is no longer needed since dev_dbg() is now used for debug messages. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/driver.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h index 35246cf..9dd8ff4 100644 --- a/drivers/staging/line6/driver.h +++ b/drivers/staging/line6/driver.h @@ -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__) -- 1.7.12.1 |
From: Stefan H. <ste...@gm...> - 2012-11-11 12:52:52
|
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. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- 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(-) diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index ac11a3b..571f2ce 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -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 (;;) { diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index 9edd053..4a86f7a 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -252,25 +252,19 @@ void line6_pod_process_message(struct usb_line6_pod *pod) break; default: - DEBUG_MESSAGES(dev_err - (pod-> - line6.ifcdev, - "unknown dump code %02X\n", - pod-> - dumpreq.in_progress)); + dev_dbg(pod->line6.ifcdev, + "unknown dump code %02X\n", + pod->dumpreq.in_progress); } line6_dump_finished(&pod->dumpreq); pod_startup3(pod); } else - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "wrong size of channel dump message (%d instead of %d)\n", - pod-> - line6.message_length, - (int) - sizeof(pod->prog_data) + - 7)); + 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); break; @@ -302,11 +296,9 @@ void line6_pod_process_message(struct usb_line6_pod *pod) #undef PROCESS_SYSTEM_PARAM default: - DEBUG_MESSAGES(dev_err - (pod-> - line6.ifcdev, - "unknown tuner/system response %02X\n", - buf[6])); + dev_dbg(pod->line6.ifcdev, + "unknown tuner/system response %02X\n", + buf[6]); } break; @@ -321,25 +313,21 @@ void line6_pod_process_message(struct usb_line6_pod *pod) break; case POD_SYSEX_CLIP: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "audio clipped\n")); + dev_dbg(pod->line6.ifcdev, "audio clipped\n"); pod->clipping.value = 1; wake_up(&pod->clipping.wait); break; case POD_SYSEX_STORE: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "message %02X not yet implemented\n", - buf[5])); + dev_dbg(pod->line6.ifcdev, + "message %02X not yet implemented\n", + buf[5]); break; default: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "unknown sysex message %02X\n", - buf[5])); + dev_dbg(pod->line6.ifcdev, + "unknown sysex message %02X\n", + buf[5]); } } else if (memcmp @@ -352,9 +340,7 @@ void line6_pod_process_message(struct usb_line6_pod *pod) buf[10]; pod_startup4(pod); } else - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "unknown sysex header\n")); + dev_dbg(pod->line6.ifcdev, "unknown sysex header\n"); break; @@ -362,9 +348,8 @@ void line6_pod_process_message(struct usb_line6_pod *pod) break; default: - DEBUG_MESSAGES(dev_err - (pod->line6.ifcdev, - "POD: unknown message %02X\n", buf[0])); + dev_dbg(pod->line6.ifcdev, "POD: unknown message %02X\n", + buf[0]); } } diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 1b85ecc..8df529f 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -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]); } } -- 1.7.12.1 |
From: Dan C. <dan...@or...> - 2012-11-14 14:42:19
|
On Sun, Nov 11, 2012 at 01:52:24PM +0100, Stefan Hajnoczi wrote: > + 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 |
From: Stefan H. <ste...@gm...> - 2012-11-11 12:52:55
|
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. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/Kconfig | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig index 43120ff..a5ded12 100644 --- a/drivers/staging/line6/Kconfig +++ b/drivers/staging/line6/Kconfig @@ -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 -- 1.7.12.1 |
From: Stefan H. <ste...@gm...> - 2012-11-11 12:54:20
|
On Sun, Nov 11, 2012 at 1:52 PM, Stefan Hajnoczi <ste...@gm...> wrote: > Daniel Mack <zo...@gm...> 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(-) I forgot to mention these patches apply on top of the "staging: line6: checkpatch.pl cleanups" series I sent earlier today. Stefan |