[alsa-devel] [PATCH 2/8] ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set

Daniel Mack zonque at gmail.com
Wed May 18 11:28:39 CEST 2011


Just defining it to nothing is dangerous as it can alter the code
execution flow, for example when used in as only function in a
conditional code block.

Signed-off-by: Daniel Mack <zonque at gmail.com>
---
 sound/usb/debug.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/usb/debug.h b/sound/usb/debug.h
index 343ec2d..5803017 100644
--- a/sound/usb/debug.h
+++ b/sound/usb/debug.h
@@ -8,7 +8,7 @@
 #ifdef HW_CONST_DEBUG
 #define hwc_debug(fmt, args...) printk(KERN_DEBUG fmt, ##args)
 #else
-#define hwc_debug(fmt, args...) /**/
+#define hwc_debug(fmt, args...) do { } while(0)
 #endif
 
 #endif /* __USBAUDIO_DEBUG_H */
-- 
1.7.5.1



More information about the Alsa-devel mailing list