ALSA: hda: fix unused variable warning
authorAnders Roxell <anders.roxell@linaro.org>
Tue, 11 Sep 2018 14:18:36 +0000 (16:18 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Sep 2018 14:46:42 +0000 (16:46 +0200)
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>
sound/pci/hda/hda_controller.h

index 0053b704ddc4a1260c133f740343e890b1492806..c95097bb5a0c0312a03cce011a0ca16c34462d83 100644 (file)
@@ -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;
+}
 
 /*
  * macros for easy use