Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762987AbYBULT1 (ORCPT ); Thu, 21 Feb 2008 06:19:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755001AbYBULTQ (ORCPT ); Thu, 21 Feb 2008 06:19:16 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40017 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754086AbYBULTP (ORCPT ); Thu, 21 Feb 2008 06:19:15 -0500 Date: Thu, 21 Feb 2008 12:19:14 +0100 Message-ID: From: Takashi Iwai To: Clemens Ladisch Cc: Joshua Roys , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [alsa-devel] [PATCH] Fix a compile warning under gcc-4.2.3. In-Reply-To: <47BD3ADE.8040501@ladisch.de> References: <1203528197-24227-1-git-send-email-roysjosh@gmail.com> <47BD3ADE.8040501@ladisch.de> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (+CVS-20070806) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1879 Lines: 52 At Thu, 21 Feb 2008 09:48:30 +0100, Clemens Ladisch wrote: > > Joshua Roys wrote: > > sound/core/init.c: In function ?snd_card_disconnect?: > > sound/core/init.c:307: warning: the address of ?snd_shutdown_f_ops? will always evaluate as ?true? > > > > Signed-off-by: Joshua Roys > > --- > > sound/core/init.c | 1 - > > 1 files changed, 0 insertions(+), 1 deletions(-) > > > > diff --git a/sound/core/init.c b/sound/core/init.c > > index 2cb7099..1afc58b 100644 > > --- a/sound/core/init.c > > +++ b/sound/core/init.c > > @@ -304,7 +304,6 @@ int snd_card_disconnect(struct snd_card *card) > > list_add(&mfile->shutdown_list, &shutdown_files); > > spin_unlock(&shutdown_lock); > > > > - fops_get(&snd_shutdown_f_ops); > > mfile->file->f_op = &snd_shutdown_f_ops; > > > > mfile = mfile->next; > > This change may get rid of the warning, but is has the slight > disadvantage that the kernel will blow up if you try to unload the sound > modules before all device files have been closed. > > If you want to get rid of this warning, tell the compiler that fops_get > knows what it does; or try making fops_get an inline function instead of > a macro. This was already fixed in a different way on 2.6.25-rc. commit bc9abce0de0b180817bc7e9f73145ef0b6a464ef Author: Miguel Boton Date: Sun Jan 13 12:03:53 2008 +0100 [ALSA] fix compilation warning in GCC 'snd_shutdown_f_ops' is not a pointer so its address will never be NULL. GCC will complain because 'fops_get' will do an unnecessary check because '&snd_shutdown_f_ops' is always true. Takashi -- 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/