aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-11-07 03:08:15 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-07 03:08:15 -0500
commit945eed02cd619f525e097319cd3d18c58d01da87 (patch)
treeb6cf5b5b17fea72d4c2140f0307f1790c173e595
parent63cf123bf5d538a066e4a899390c9ce56ab6df9f (diff)
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>
-rw-r--r--include/sound/core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 7e5589472681..6fa4c7b1970a 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -390,11 +390,11 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
390 390
391#define snd_printd(fmt, args...) do { } while (0) 391#define snd_printd(fmt, args...) do { } while (0)
392#define snd_BUG() do { } while (0) 392#define snd_BUG() do { } while (0)
393static inline int __snd_bug_on(void) 393static inline int __snd_bug_on(int cond)
394{ 394{
395 return 0; 395 return 0;
396} 396}
397#define snd_BUG_ON(cond) __snd_bug_on() /* always false */ 397#define snd_BUG_ON(cond) __snd_bug_on(0 && (cond)) /* always false */
398 398
399#endif /* CONFIG_SND_DEBUG */ 399#endif /* CONFIG_SND_DEBUG */
400 400