Skip to contentSkip to conversation

ALSA: interwave: fix build warnings with CONFIG_PM=n

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 13 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: interwave: fix build warnings with CONFIG_PM=n

From: Arnd Bergmann <[email protected]>

Parts of the newly added power management code are identified as unused by gcc:

sound/isa/gus/interwave.c:489:13: error: 'snd_interwave_restore_memory' defined but not used [-Werror=unused-function]
489 | static void snd_interwave_restore_memory(struct snd_gus_card *gus)

      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/isa/gus/interwave.c:483:13: error: 'snd_interwave_restore_regs' defined but not used [-Werror=unused-function]
  483 | static void snd_interwave_restore_regs(struct snd_gus_card *gus)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sound/isa/gus/interwave-stb.c:3:
sound/isa/gus/interwave.c:489:13: error: 'snd_interwave_restore_memory' defined but not used [-Werror=unused-function]
  489 | static void snd_interwave_restore_memory(struct snd_gus_card *gus)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/isa/gus/interwave.c:483:13: error: 'snd_interwave_restore_regs' defined but not used [-Werror=unused-function]
  483 | static void snd_interwave_restore_regs(struct snd_gus_card *gus)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~

Add an #ifdef check around these to match the callers.

Fixes 6f800c3397b7 ("ALSA: interwave: add ISA and PnP suspend and resume callbacks")
---
 sound/isa/gus/interwave.c | 2 ++
 1 file changed, 2 insertions(+)
sound/isa/gus/interwave.c +2 -0
index 616c11e51a2f..bd13350038d2 100644
@@ -480,6 +480,7 @@ static void __snd_interwave_restore_regs(struct snd_gus_card *gus)
 	snd_gf1_write8(gus, SNDRV_GF1_GB_EMULATION_IRQ, 0x00);
 }
 
+#ifdef CONFIG_PM
 static void snd_interwave_restore_regs(struct snd_gus_card *gus)
 {
 	scoped_guard(spinlock_irqsave, &gus->reg_lock)
@@ -517,6 +518,7 @@ static void snd_interwave_restore_memory(struct snd_gus_card *gus)
 		snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, mem_cfg);
 	}
 }
+#endif
 
 static void snd_interwave_init(int dev, struct snd_gus_card *gus)
 {
Signature · 1 line
2.39.5
#1 lore raw
Quoted 20 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Parts of the newly added power management code are identified as unused by gcc:

sound/isa/gus/interwave.c:489:13: error: 'snd_interwave_restore_memory' defined but not used [-Werror=unused-function]
489 | static void snd_interwave_restore_memory(struct snd_gus_card *gus)

      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/isa/gus/interwave.c:483:13: error: 'snd_interwave_restore_regs' defined but not used [-Werror=unused-function]
  483 | static void snd_interwave_restore_regs(struct snd_gus_card *gus)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sound/isa/gus/interwave-stb.c:3:
sound/isa/gus/interwave.c:489:13: error: 'snd_interwave_restore_memory' defined but not used [-Werror=unused-function]
  489 | static void snd_interwave_restore_memory(struct snd_gus_card *gus)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/isa/gus/interwave.c:483:13: error: 'snd_interwave_restore_regs' defined but not used [-Werror=unused-function]
  483 | static void snd_interwave_restore_regs(struct snd_gus_card *gus)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 4 lines

Add an #ifdef check around these to match the callers.

Fixes 6f800c3397b7 ("ALSA: interwave: add ISA and PnP suspend and resume callbacks")

Thanks, this should have been already fixed on sound git tree by the commit b7feba842c0d5f6c5b01592f80d164e974767501
ALSA: interwave: guard PM-only restore helpers with CONFIG_PM

Takashi