From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754032AbYJCJK0 (ORCPT ); Fri, 3 Oct 2008 05:10:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752461AbYJCJKM (ORCPT ); Fri, 3 Oct 2008 05:10:12 -0400 Received: from cantor.suse.de ([195.135.220.2]:43345 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbYJCJKL (ORCPT ); Fri, 3 Oct 2008 05:10:11 -0400 Date: Fri, 03 Oct 2008 11:10:09 +0200 Message-ID: From: Takashi Iwai To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Andrew Morton , Jaroslav Kysela , Steven Rostedt Subject: Re: [PATCH 4/5] sound: update snd_assert macro In-Reply-To: <20081002151104.821728138@goodmis.org> References: <20081002150529.087488257@goodmis.org> <20081002151104.821728138@goodmis.org> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.2 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Thu, 02 Oct 2008 11:05:33 -0400, Steven Rostedt wrote: > > One user of the snd_assert macro calls a goto and the compiler > complains that the label is not used when the snd_assert is > not set. > > This patch makes snd_assert more robust when not defined to > let the compiler know about arguments when not in use. This issue was already fixed differently in the recent ALSA tree (thus in linux-next tree as well). thanks, Takashi > > CC: Jaroslav Kysela > Signed-off-by: Steven Rostedt > --- > include/sound/core.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > Index: linux-compile.git/include/sound/core.h > =================================================================== > --- linux-compile.git.orig/include/sound/core.h 2008-07-27 09:26:33.000000000 -0400 > +++ linux-compile.git/include/sound/core.h 2008-10-02 10:00:57.000000000 -0400 > @@ -407,7 +407,13 @@ void snd_verbose_printd(const char *file > #else /* !CONFIG_SND_DEBUG */ > > #define snd_printd(fmt, args...) /* nothing */ > -#define snd_assert(expr, args...) (void)(expr) > +/* Keep the compiler happy by showing the expr and args */ > +#define snd_assert(expr, args...) do { \ > + if (0) { \ > + (void)(expr); \ > + args; \ > + } \ > +} while(0) > #define snd_BUG() /* nothing */ > > #endif /* CONFIG_SND_DEBUG */ > > -- > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >