瀏覽代碼

ALSA: Evaluate condition in snd_BUG_ON() in non-debugging case

Change snd_BUG_ON() to evaluate the given condition, at least, in syntax
for avoiding compile warnings such as unused variables.  The compiler
should optimize out the condition evaluation in the real code, though.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 16 年之前
父節點
當前提交
945eed02cd
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      include/sound/core.h

+ 2 - 2
include/sound/core.h

@@ -390,11 +390,11 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
 
 
 #define snd_printd(fmt, args...)	do { } while (0)
 #define snd_printd(fmt, args...)	do { } while (0)
 #define snd_BUG()			do { } while (0)
 #define snd_BUG()			do { } while (0)
-static inline int __snd_bug_on(void)
+static inline int __snd_bug_on(int cond)
 {
 {
 	return 0;
 	return 0;
 }
 }
-#define snd_BUG_ON(cond)		__snd_bug_on()  /* always false */
+#define snd_BUG_ON(cond)	__snd_bug_on(0 && (cond))  /* always false */
 
 
 #endif /* CONFIG_SND_DEBUG */
 #endif /* CONFIG_SND_DEBUG */