summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2018-09-11 16:18:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-27 14:46:03 +0100
commit961e9f394d4ce5ec9518bd2c04469da5d2d9d3b3 (patch)
tree1fa179e2a9c7b5d82137dccb43497bbec4ec85ab /sound
parent81f7d38650d13e431464e4935d188900bbd2ce5b (diff)
ALSA: hda: fix unused variable warning
[ Upstream commit 5b03006d5c58ddd31caf542eef4d0269bcf265b3 ] 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@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_controller.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h
index 8a9dd4767b1e..63cc10604afc 100644
--- a/sound/pci/hda/hda_controller.h
+++ b/sound/pci/hda/hda_controller.h
@@ -176,11 +176,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