alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda - Silence PM ops build warning
@ 2018-03-29 11:46 Lukas Wunner
  2018-03-29 11:51 ` Takashi Iwai
  2018-04-13  4:27 ` Lukas Wunner
  0 siblings, 2 replies; 4+ messages in thread
From: Lukas Wunner @ 2018-03-29 11:46 UTC (permalink / raw)
  To: dri-devel, alsa-devel, Arnd Bergmann, Takashi Iwai

The system sleep PM ops azx_suspend() and azx_resume() were previously
called by vga_switcheroo, but commit 07f4f97d7b4b ("vga_switcheroo: Use
device link for HDA controller") removed their invocation.

Unfortunately the commit neglected to update the #ifdef surrounding the
two functions, so if CONFIG_PM_SLEEP is *not* enabled but all three of
CONFIG_PM, CONFIG_VGA_SWITCHEROO and CONFIG_SND_HDA_CODEC_HDMI *are*
enabled, the compiler now emits the following warning:

sound/pci/hda/hda_intel.c:1024:12: warning: 'azx_resume' defined but not used [-Wunused-function]
 static int azx_resume(struct device *dev)
            ^~~~~~~~~~
sound/pci/hda/hda_intel.c:989:12: warning: 'azx_suspend' defined but not used [-Wunused-function]
 static int azx_suspend(struct device *dev)
            ^~~~~~~~~~~

Silence by updating the #ifdef.  Because the #ifdef block now uses the
same condition as the one immediately succeeding it, the two blocks can
be collapsed together, shaving off another two lines.

Fixes: 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
Cc: Takashi Iwai <tiwai@suse.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
 sound/pci/hda/hda_intel.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ec4e6b829ee2..d653c56e9141 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -982,7 +982,7 @@ static int param_set_xint(const char *val, const struct kernel_param *kp)
 #define azx_del_card_list(chip) /* NOP */
 #endif /* CONFIG_PM */
 
-#if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO)
+#ifdef CONFIG_PM_SLEEP
 /*
  * power management
  */
@@ -1063,9 +1063,7 @@ static int azx_resume(struct device *dev)
 	trace_azx_resume(chip);
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */
 
-#ifdef CONFIG_PM_SLEEP
 /* put codec down to D3 at hibernation for Intel SKL+;
  * otherwise BIOS may still access the codec and screw up the driver
  */
-- 
2.16.2

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

* Re: [PATCH] ALSA: hda - Silence PM ops build warning
  2018-03-29 11:46 [PATCH] ALSA: hda - Silence PM ops build warning Lukas Wunner
@ 2018-03-29 11:51 ` Takashi Iwai
  2018-03-29 20:15   ` Lukas Wunner
  2018-04-13  4:27 ` Lukas Wunner
  1 sibling, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2018-03-29 11:51 UTC (permalink / raw)
  To: Lukas Wunner; +Cc: alsa-devel, dri-devel, Arnd Bergmann

On Thu, 29 Mar 2018 13:46:26 +0200,
Lukas Wunner wrote:
> 
> The system sleep PM ops azx_suspend() and azx_resume() were previously
> called by vga_switcheroo, but commit 07f4f97d7b4b ("vga_switcheroo: Use
> device link for HDA controller") removed their invocation.
> 
> Unfortunately the commit neglected to update the #ifdef surrounding the
> two functions, so if CONFIG_PM_SLEEP is *not* enabled but all three of
> CONFIG_PM, CONFIG_VGA_SWITCHEROO and CONFIG_SND_HDA_CODEC_HDMI *are*
> enabled, the compiler now emits the following warning:
> 
> sound/pci/hda/hda_intel.c:1024:12: warning: 'azx_resume' defined but not used [-Wunused-function]
>  static int azx_resume(struct device *dev)
>             ^~~~~~~~~~
> sound/pci/hda/hda_intel.c:989:12: warning: 'azx_suspend' defined but not used [-Wunused-function]
>  static int azx_suspend(struct device *dev)
>             ^~~~~~~~~~~
> 
> Silence by updating the #ifdef.  Because the #ifdef block now uses the
> same condition as the one immediately succeeding it, the two blocks can
> be collapsed together, shaving off another two lines.
> 
> Fixes: 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
> Cc: Takashi Iwai <tiwai@suse.com>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Reviewed-by: Takashi Iwai <tiwai@suse.de>

Can this go through drm(-misc) tree as the original commit stays?


thanks,

Takashi

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

* Re: [PATCH] ALSA: hda - Silence PM ops build warning
  2018-03-29 11:51 ` Takashi Iwai
@ 2018-03-29 20:15   ` Lukas Wunner
  0 siblings, 0 replies; 4+ messages in thread
From: Lukas Wunner @ 2018-03-29 20:15 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, dri-devel, Arnd Bergmann, Jaroslav Kysela

On Thu, Mar 29, 2018 at 01:51:43PM +0200, Takashi Iwai wrote:
> On Thu, 29 Mar 2018 13:46:26 +0200, Lukas Wunner wrote:
> > The system sleep PM ops azx_suspend() and azx_resume() were previously
> > called by vga_switcheroo, but commit 07f4f97d7b4b ("vga_switcheroo: Use
> > device link for HDA controller") removed their invocation.
> > 
> > Unfortunately the commit neglected to update the #ifdef surrounding the
> > two functions, so if CONFIG_PM_SLEEP is *not* enabled but all three of
> > CONFIG_PM, CONFIG_VGA_SWITCHEROO and CONFIG_SND_HDA_CODEC_HDMI *are*
> > enabled, the compiler now emits the following warning:
> > 
> > sound/pci/hda/hda_intel.c:1024:12: warning: 'azx_resume' defined but not used [-Wunused-function]
> >  static int azx_resume(struct device *dev)
> >             ^~~~~~~~~~
> > sound/pci/hda/hda_intel.c:989:12: warning: 'azx_suspend' defined but not used [-Wunused-function]
> >  static int azx_suspend(struct device *dev)
> >             ^~~~~~~~~~~
> > 
> > Silence by updating the #ifdef.  Because the #ifdef block now uses the
> > same condition as the one immediately succeeding it, the two blocks can
> > be collapsed together, shaving off another two lines.
> > 
> > Fixes: 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller")
> > Cc: Takashi Iwai <tiwai@suse.com>
> > Reported-by: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> 
> Reviewed-by: Takashi Iwai <tiwai@suse.de>
> 
> Can this go through drm(-misc) tree as the original commit stays?

Pushed to drm-misc-next-fixes, thanks for the report and review.

Sorry, you were super fast with the review, but I wanted to give folks
the chance to comment at least for a few hours before pushing, despite
this likely being an uncontroversial patch.

It was also automatically applied to the drm-misc/for-linux-next branch,
so the build warning should be gone in linux-next once it's rebuilt.
(I'm not sure if Good Friday and Easter Monday are national holidays
down under, as they are in Germany, but I hope Stephen will rebuild
Tuesday at the latest.)

Peaceful Easter holidays to everyone,

Lukas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] ALSA: hda - Silence PM ops build warning
  2018-03-29 11:46 [PATCH] ALSA: hda - Silence PM ops build warning Lukas Wunner
  2018-03-29 11:51 ` Takashi Iwai
@ 2018-04-13  4:27 ` Lukas Wunner
  1 sibling, 0 replies; 4+ messages in thread
From: Lukas Wunner @ 2018-04-13  4:27 UTC (permalink / raw)
  To: dri-devel, alsa-devel, Arnd Bergmann, Takashi Iwai

On Thu, Mar 29, 2018 at 01:46:26PM +0200, Lukas Wunner wrote:
> sound/pci/hda/hda_intel.c:1024:12: warning: 'azx_resume' defined but not used [-Wunused-function]
>  static int azx_resume(struct device *dev)
>             ^~~~~~~~~~
> sound/pci/hda/hda_intel.c:989:12: warning: 'azx_suspend' defined but not used [-Wunused-function]
>  static int azx_suspend(struct device *dev)
>             ^~~~~~~~~~~

Arnd, Takashi, just a quick FYI that the fix for the above-quoted
warnings has landed in Linus' tree half an hour ago.  Thanks for
your patience.

Lukas

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

end of thread, other threads:[~2018-04-13  4:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-29 11:46 [PATCH] ALSA: hda - Silence PM ops build warning Lukas Wunner
2018-03-29 11:51 ` Takashi Iwai
2018-03-29 20:15   ` Lukas Wunner
2018-04-13  4:27 ` Lukas Wunner

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).