Commit d19f03d5 authored by Anders Roxell's avatar Anders Roxell Committed by Kleber Sacilotto de Souza

ALSA: hda: fix unused variable warning

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit 5b03006d ]

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: a41d1224 ("ALSA: hda - Embed bus into controller object")
Signed-off-by: default avatarAnders Roxell <anders.roxell@linaro.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 56860dfe
......@@ -164,11 +164,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;
}
/*
* macros for easy use
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment