LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend()
@ 2021-08-18  1:27 Nathan Chancellor
  2021-08-18  1:27 ` [PATCH 2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards Nathan Chancellor
  2021-08-18  5:51 ` [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() Takashi Iwai
  0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2021-08-18  1:27 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel, Nathan Chancellor

When CONFIG_PM is not set, there is an unused function warning:

sound/pci/hda/patch_sigmatel.c:4383:13: warning: unused function
'stac_shutup' [-Wunused-function]
static void stac_shutup(struct hda_codec *codec)
            ^
1 warning generated.

Sink the contents of stac_shutup() into stac_suspend() since
stac_shutup() is only called in that one location now.

Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/pci/hda/patch_sigmatel.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 3e00116db86e..61df4d33c48f 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4380,18 +4380,6 @@ static int stac_init(struct hda_codec *codec)
 	return 0;
 }
 
-static void stac_shutup(struct hda_codec *codec)
-{
-	struct sigmatel_spec *spec = codec->spec;
-
-	snd_hda_shutup_pins(codec);
-
-	if (spec->eapd_mask)
-		stac_gpio_set(codec, spec->gpio_mask,
-				spec->gpio_dir, spec->gpio_data &
-				~spec->eapd_mask);
-}
-
 #define stac_free	snd_hda_gen_free
 
 #ifdef CONFIG_SND_PROC_FS
@@ -4444,7 +4432,15 @@ static void stac927x_proc_hook(struct snd_info_buffer *buffer,
 #ifdef CONFIG_PM
 static int stac_suspend(struct hda_codec *codec)
 {
-	stac_shutup(codec);
+	struct sigmatel_spec *spec = codec->spec;
+
+	snd_hda_shutup_pins(codec);
+
+	if (spec->eapd_mask)
+		stac_gpio_set(codec, spec->gpio_mask,
+				spec->gpio_dir, spec->gpio_data &
+				~spec->eapd_mask);
+
 	return 0;
 }
 #else

base-commit: 8fc8e903156f42c66245838441d03607e9067381
-- 
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards
  2021-08-18  1:27 [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() Nathan Chancellor
@ 2021-08-18  1:27 ` Nathan Chancellor
  2021-08-18  5:51   ` Takashi Iwai
  2021-08-18  5:51 ` [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() Takashi Iwai
  1 sibling, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2021-08-18  1:27 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel, Nathan Chancellor

When CONFIG_PM is not set, there is an unused function warning:

sound/pci/hda/patch_analog.c:115:13: warning: unused function
'ad198x_shutup' [-Wunused-function]
static void ad198x_shutup(struct hda_codec *codec)
            ^
1 warning generated.

Sink ad198x_shutup() into ad198x_suspend(), as it is only called in that
one space. Move the CONFIG_PM guards above ad198x_power_eapd_write() as
it is only called in ad198x_power_eapd(), which is in turn only called
in ad198x_power_eapd(). Those two functions are large enough that they
are left alone.

Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/pci/hda/patch_analog.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index a356e1662929..8afe6000f7da 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,7 +72,7 @@ static int create_beep_ctls(struct hda_codec *codec)
 #define create_beep_ctls(codec)		0
 #endif
 
-
+#ifdef CONFIG_PM
 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
 				hda_nid_t hp)
 {
@@ -112,16 +112,10 @@ static void ad198x_power_eapd(struct hda_codec *codec)
 	}
 }
 
-static void ad198x_shutup(struct hda_codec *codec)
+static int ad198x_suspend(struct hda_codec *codec)
 {
 	snd_hda_shutup_pins(codec);
 	ad198x_power_eapd(codec);
-}
-
-#ifdef CONFIG_PM
-static int ad198x_suspend(struct hda_codec *codec)
-{
-	ad198x_shutup(codec);
 	return 0;
 }
 #endif
-- 
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend()
  2021-08-18  1:27 [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() Nathan Chancellor
  2021-08-18  1:27 ` [PATCH 2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards Nathan Chancellor
@ 2021-08-18  5:51 ` Takashi Iwai
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-08-18  5:51 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel

On Wed, 18 Aug 2021 03:27:04 +0200,
Nathan Chancellor wrote:
> 
> When CONFIG_PM is not set, there is an unused function warning:
> 
> sound/pci/hda/patch_sigmatel.c:4383:13: warning: unused function
> 'stac_shutup' [-Wunused-function]
> static void stac_shutup(struct hda_codec *codec)
>             ^
> 1 warning generated.
> 
> Sink the contents of stac_shutup() into stac_suspend() since
> stac_shutup() is only called in that one location now.
> 
> Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards
  2021-08-18  1:27 ` [PATCH 2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards Nathan Chancellor
@ 2021-08-18  5:51   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-08-18  5:51 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel

On Wed, 18 Aug 2021 03:27:05 +0200,
Nathan Chancellor wrote:
> 
> When CONFIG_PM is not set, there is an unused function warning:
> 
> sound/pci/hda/patch_analog.c:115:13: warning: unused function
> 'ad198x_shutup' [-Wunused-function]
> static void ad198x_shutup(struct hda_codec *codec)
>             ^
> 1 warning generated.
> 
> Sink ad198x_shutup() into ad198x_suspend(), as it is only called in that
> one space. Move the CONFIG_PM guards above ad198x_power_eapd_write() as
> it is only called in ad198x_power_eapd(), which is in turn only called
> in ad198x_power_eapd(). Those two functions are large enough that they
> are left alone.
> 
> Fixes: 327b34f2a97d ("ALSA: hda: Nuke unused reboot_notify callback")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-18  5:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18  1:27 [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() Nathan Chancellor
2021-08-18  1:27 ` [PATCH 2/2] ALSA: hda/analog - Sink ad198x_shutup() and shuffle CONFIG_PM guards Nathan Chancellor
2021-08-18  5:51   ` Takashi Iwai
2021-08-18  5:51 ` [PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend() Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).