mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused
@ 2017-02-07 13:38 Arnd Bergmann
  2017-02-07 14:17 ` Takashi Iwai
  2017-02-07 14:19 ` Takashi Sakamoto
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-02-07 13:38 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Arnd Bergmann, Pierre-Louis Bossart, Jerome Anand, alsa-devel,
	linux-kernel

The two functions are unused when CONFIG_PM_SLEEP is disabled:

sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' defined but not used [-Werror=unused-function]
sound/x86/intel_hdmi_audio.c:1622:12: error: 'hdmi_lpe_audio_suspend' defined but not used [-Werror=unused-function]

Marking them as __maybe_unused avoids the warning without introducing an
ugly #ifdef.

Fixes: 182cdf23dbf6 ("ALSA: x86: Implement runtime PM")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/x86/intel_hdmi_audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 8978dc9bf579..0d19a4994bac 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1619,7 +1619,7 @@ static int hdmi_lpe_audio_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int hdmi_lpe_audio_suspend(struct device *dev)
+static int __maybe_unused hdmi_lpe_audio_suspend(struct device *dev)
 {
 	struct snd_intelhad *ctx = dev_get_drvdata(dev);
 	int err;
@@ -1630,7 +1630,7 @@ static int hdmi_lpe_audio_suspend(struct device *dev)
 	return err;
 }
 
-static int hdmi_lpe_audio_resume(struct device *dev)
+static int __maybe_unused hdmi_lpe_audio_resume(struct device *dev)
 {
 	struct snd_intelhad *ctx = dev_get_drvdata(dev);
 
-- 
2.9.0

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

* Re: [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused
  2017-02-07 13:38 [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused Arnd Bergmann
@ 2017-02-07 14:17 ` Takashi Iwai
  2017-02-07 14:19 ` Takashi Sakamoto
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2017-02-07 14:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jaroslav Kysela, alsa-devel, Jerome Anand, Pierre-Louis Bossart,
	linux-kernel

On Tue, 07 Feb 2017 14:38:51 +0100,
Arnd Bergmann wrote:
> 
> The two functions are unused when CONFIG_PM_SLEEP is disabled:
> 
> sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' defined but not used [-Werror=unused-function]
> sound/x86/intel_hdmi_audio.c:1622:12: error: 'hdmi_lpe_audio_suspend' defined but not used [-Werror=unused-function]
> 
> Marking them as __maybe_unused avoids the warning without introducing an
> ugly #ifdef.
> 
> Fixes: 182cdf23dbf6 ("ALSA: x86: Implement runtime PM")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks!


Takashi

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

* Re: [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused
  2017-02-07 13:38 [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused Arnd Bergmann
  2017-02-07 14:17 ` Takashi Iwai
@ 2017-02-07 14:19 ` Takashi Sakamoto
  2017-02-07 15:10   ` Takashi Iwai
  1 sibling, 1 reply; 4+ messages in thread
From: Takashi Sakamoto @ 2017-02-07 14:19 UTC (permalink / raw)
  To: Arnd Bergmann, Jaroslav Kysela, Takashi Iwai
  Cc: linux-kernel, alsa-devel, Pierre-Louis Bossart, Jerome Anand

Hi,

On Feb 7 2016 22:38, Arnd Bergmann wrote:
> The two functions are unused when CONFIG_PM_SLEEP is disabled:
>
> sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' defined but not used [-Werror=unused-function]
> sound/x86/intel_hdmi_audio.c:1622:12: error: 'hdmi_lpe_audio_suspend' defined but not used [-Werror=unused-function]
>
> Marking them as __maybe_unused avoids the warning without introducing an
> ugly #ifdef.
>
> Fixes: 182cdf23dbf6 ("ALSA: x86: Implement runtime PM")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  sound/x86/intel_hdmi_audio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
> index 8978dc9bf579..0d19a4994bac 100644
> --- a/sound/x86/intel_hdmi_audio.c
> +++ b/sound/x86/intel_hdmi_audio.c
> @@ -1619,7 +1619,7 @@ static int hdmi_lpe_audio_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>
> -static int hdmi_lpe_audio_suspend(struct device *dev)
> +static int __maybe_unused hdmi_lpe_audio_suspend(struct device *dev)
>  {
>  	struct snd_intelhad *ctx = dev_get_drvdata(dev);
>  	int err;
> @@ -1630,7 +1630,7 @@ static int hdmi_lpe_audio_suspend(struct device *dev)
>  	return err;
>  }
>
> -static int hdmi_lpe_audio_resume(struct device *dev)
> +static int __maybe_unused hdmi_lpe_audio_resume(struct device *dev)
>  {
>  	struct snd_intelhad *ctx = dev_get_drvdata(dev);

In this case, in this subsystem, we can see codes to pre-process the 
function calls to NULL and the function definition is omitted. This is a 
sample:
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/hda/patch_sigmatel.c#n4427

Let us apply the same idea to this module?


Thanks

Takashi Sakamoto

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

* Re: [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused
  2017-02-07 14:19 ` Takashi Sakamoto
@ 2017-02-07 15:10   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2017-02-07 15:10 UTC (permalink / raw)
  To: Takashi Sakamoto
  Cc: Arnd Bergmann, Jaroslav Kysela, alsa-devel, Jerome Anand,
	Pierre-Louis Bossart, linux-kernel

On Tue, 07 Feb 2017 15:19:47 +0100,
Takashi Sakamoto wrote:
> 
> Hi,
> 
> On Feb 7 2016 22:38, Arnd Bergmann wrote:
> > The two functions are unused when CONFIG_PM_SLEEP is disabled:
> >
> > sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' defined but not used [-Werror=unused-function]
> > sound/x86/intel_hdmi_audio.c:1622:12: error: 'hdmi_lpe_audio_suspend' defined but not used [-Werror=unused-function]
> >
> > Marking them as __maybe_unused avoids the warning without introducing an
> > ugly #ifdef.
> >
> > Fixes: 182cdf23dbf6 ("ALSA: x86: Implement runtime PM")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  sound/x86/intel_hdmi_audio.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
> > index 8978dc9bf579..0d19a4994bac 100644
> > --- a/sound/x86/intel_hdmi_audio.c
> > +++ b/sound/x86/intel_hdmi_audio.c
> > @@ -1619,7 +1619,7 @@ static int hdmi_lpe_audio_runtime_suspend(struct device *dev)
> >  	return 0;
> >  }
> >
> > -static int hdmi_lpe_audio_suspend(struct device *dev)
> > +static int __maybe_unused hdmi_lpe_audio_suspend(struct device *dev)
> >  {
> >  	struct snd_intelhad *ctx = dev_get_drvdata(dev);
> >  	int err;
> > @@ -1630,7 +1630,7 @@ static int hdmi_lpe_audio_suspend(struct device *dev)
> >  	return err;
> >  }
> >
> > -static int hdmi_lpe_audio_resume(struct device *dev)
> > +static int __maybe_unused hdmi_lpe_audio_resume(struct device *dev)
> >  {
> >  	struct snd_intelhad *ctx = dev_get_drvdata(dev);
> 
> In this case, in this subsystem, we can see codes to pre-process the
> function calls to NULL and the function definition is omitted. This is
> a sample:
> https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/hda/patch_sigmatel.c#n4427
> 
> Let us apply the same idea to this module?

In the case of HD-audio, the dependency is more complex, and
__maybe_unused will omit the warning we really want to see if the
dependency is broken.  So, better not touch it.

For a simpler driver, it's fine to take this approach, yes.
But you don't have to rush now unless you've seen the similar warnings
and need some fix.  It's already close to the merge window, and such a
cleanup would bring an error by mistake.


thanks,

Takashi

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

end of thread, other threads:[~2017-02-07 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 13:38 [PATCH] ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused Arnd Bergmann
2017-02-07 14:17 ` Takashi Iwai
2017-02-07 14:19 ` Takashi Sakamoto
2017-02-07 15:10   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®