Skip to contentSkip to conversation

ALSA: hda - fix unused Realtek function when PM is not enabled

PATCH Applied Randy Dunlap 2 participants 2 messages Apr 30, 2022 – May 8, 2022 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - fix unused Realtek function when PM is not enabled

When CONFIG_PM is not enabled, alc_shutup() is not needed, so move it inside the #ifdef CONFIG_PM guard.
Also drop some contiguous #endif / #ifdef CONFIG_PM for simplicity.

Fixes this build warning:
sound/pci/hda/patch_realtek.c:886:20: warning: unused function 'alc_shutup'

Fixes 08c189f2c552 ("ALSA: hda - Use generic parser codes for Realtek driver")
Cc Takashi Iwai <[email protected]>
Cc Jaroslav Kysela <[email protected]>
---
 sound/pci/hda/patch_realtek.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
sound/pci/hda/patch_realtek.c +3 -5
@@ -937,6 +937,9 @@ static int alc_init(struct hda_codec *co
 	return 0;
 }
 
+#define alc_free	snd_hda_gen_free
+
+#ifdef CONFIG_PM
 static inline void alc_shutup(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
@@ -950,9 +953,6 @@ static inline void alc_shutup(struct hda
 		alc_shutup_pins(codec);
 }
 
-#define alc_free	snd_hda_gen_free
-
-#ifdef CONFIG_PM
 static void alc_power_eapd(struct hda_codec *codec)
 {
 	alc_auto_setup_eapd(codec, false);
@@ -966,9 +966,7 @@ static int alc_suspend(struct hda_codec
 		spec->power_hook(codec);
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM
 static int alc_resume(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
Applied
#1 lore raw
Quoted 8 lines · Randy Dunlap

When CONFIG_PM is not enabled, alc_shutup() is not needed, so move it inside the #ifdef CONFIG_PM guard.
Also drop some contiguous #endif / #ifdef CONFIG_PM for simplicity.

Fixes this build warning:
sound/pci/hda/patch_realtek.c:886:20: warning: unused function 'alc_shutup'

Quoted 6 lines
Fixes 08c189f2c552 ("ALSA: hda - Use generic parser codes for Realtek driver")
Cc Takashi Iwai <[email protected]>
Cc Jaroslav Kysela <[email protected]>

Thanks, applied now.

Takashi