From: Takashi Iwai Date: Fri, 7 Nov 2008 08:08:15 +0000 (+0100) Subject: ALSA: Evaluate condition in snd_BUG_ON() in non-debugging case X-Git-Tag: upstream/snapshot3+hdmi~21178^2~9^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=945eed02cd619f525e097319cd3d18c58d01da87;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/include/sound/core.h b/include/sound/core.h index 7e55894..6fa4c7b 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, ...) #define snd_printd(fmt, args...) 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; } -#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 */