lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADYN=9JqdmfVfWWWB3VtDcdVDPD6bBfKOnemaKFLd4SRrKi33g@mail.gmail.com>
Date:   Tue, 11 Sep 2018 16:18:03 +0200
From:   Anders Roxell <anders.roxell@...aro.org>
To:     tiwai@...e.de
Cc:     perex@...ex.cz, alsa-devel@...a-project.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ALSA: hda: fix unused variable warning

On Tue, 11 Sep 2018 at 10:38, Takashi Iwai <tiwai@...e.de> wrote:
>
> On Tue, 11 Sep 2018 10:25:59 +0200,
> Anders Roxell wrote:
> >
> > When CONFIG_X86=n function azx_snoop doesn't use the variable chip it
> > only returns true.
> >
> > sound/pci/hda/hda_intel.c: In function ‘dma_alloc_pages’:
> > sound/pci/hda/hda_intel.c:2002:14: warning: unused variable ‘chip’ [-Wunused-variable]
> >   struct azx *chip = bus_to_azx(bus);
> >               ^~~~
> >
> > Create a inline function of azx_snoop.
> >
> > Fixes: a41d122449be ("ALSA: hda - Embed bus into controller object")
> > Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> > ---
> >  sound/pci/hda/hda_controller.h | 9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h
> > index 0053b704ddc4..aa20048742d0 100644
> > --- a/sound/pci/hda/hda_controller.h
> > +++ b/sound/pci/hda/hda_controller.h
> > @@ -170,11 +170,10 @@ struct azx {
> >  #define azx_bus(chip)        (&(chip)->bus.core)
> >  #define bus_to_azx(_bus)     container_of(_bus, struct azx, bus.core)
> >
> > -#ifdef CONFIG_X86
> > -#define azx_snoop(chip)              ((chip)->snoop)
> > -#else
> > -#define azx_snoop(chip)              true
> > -#endif
> > +static inline bool azx_snoop(struct azx *chip)
> > +{
> > +     return IS_ENABLED(CONFIG_X86) || (chip->snoop);
> > +}
>
> The idea is good, but the patch is obviously wrong; it should be
> !IS_ENABLED() :)

oops, right.

>
> Also, please remove the parentheses around chip->snoop.

OK.

Sending v2 shortly.

Cheers,
Anders

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ