All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RESEND] usb: xhci: tegra: mark PM functions as __maybe_unused
@ 2021-09-27 14:22 Arnd Bergmann
  2021-10-05 11:06 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2021-09-27 14:22 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter, JC Kuo
  Cc: Arnd Bergmann, Yang Yingliang, Petr Mladek, Andy Shevchenko,
	linux-usb, linux-tegra, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The added #ifdefs in the PM rework were almost correct, but still
cause warnings in some randconfig builds:

drivers/usb/host/xhci-tegra.c:2147:12: error: 'tegra_xusb_resume' defined but not used [-Werror=unused-function]
 2147 | static int tegra_xusb_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-tegra.c:2105:12: error: 'tegra_xusb_suspend' defined but not used [-Werror=unused-function]
 2105 | static int tegra_xusb_suspend(struct device *dev)

Replace the #ifdef checks with simpler __maybe_unused annotations to
reliably shut up these warnings.

Fixes: d64d362f1d8b ("usb: xhci: tegra: Enable ELPG for runtime/system PM")
Reviewed-by: JC Kuo <jckuo@nvidia.com>
Link: https://lore.kernel.org/all/20210421135613.3560777-2-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/host/xhci-tegra.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 575fa89a783f..1bf494b649bd 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1787,7 +1787,6 @@ static int tegra_xusb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#if IS_ENABLED(CONFIG_PM) || IS_ENABLED(CONFIG_PM_SLEEP)
 static bool xhci_hub_ports_suspended(struct xhci_hub *hub)
 {
 	struct device *dev = hub->hcd->self.controller;
@@ -2102,7 +2101,7 @@ static int tegra_xusb_exit_elpg(struct tegra_xusb *tegra, bool runtime)
 	return err;
 }
 
-static int tegra_xusb_suspend(struct device *dev)
+static __maybe_unused int tegra_xusb_suspend(struct device *dev)
 {
 	struct tegra_xusb *tegra = dev_get_drvdata(dev);
 	int err;
@@ -2144,7 +2143,7 @@ static int tegra_xusb_suspend(struct device *dev)
 	return err;
 }
 
-static int tegra_xusb_resume(struct device *dev)
+static __maybe_unused int tegra_xusb_resume(struct device *dev)
 {
 	struct tegra_xusb *tegra = dev_get_drvdata(dev);
 	int err;
@@ -2174,10 +2173,8 @@ static int tegra_xusb_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-#ifdef CONFIG_PM
-static int tegra_xusb_runtime_suspend(struct device *dev)
+static __maybe_unused int tegra_xusb_runtime_suspend(struct device *dev)
 {
 	struct tegra_xusb *tegra = dev_get_drvdata(dev);
 	int ret;
@@ -2190,7 +2187,7 @@ static int tegra_xusb_runtime_suspend(struct device *dev)
 	return ret;
 }
 
-static int tegra_xusb_runtime_resume(struct device *dev)
+static __maybe_unused int tegra_xusb_runtime_resume(struct device *dev)
 {
 	struct tegra_xusb *tegra = dev_get_drvdata(dev);
 	int err;
@@ -2201,7 +2198,6 @@ static int tegra_xusb_runtime_resume(struct device *dev)
 
 	return err;
 }
-#endif
 
 static const struct dev_pm_ops tegra_xusb_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra_xusb_runtime_suspend,
-- 
2.29.2


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

* Re: [PATCH] [RESEND] usb: xhci: tegra: mark PM functions as __maybe_unused
  2021-09-27 14:22 [PATCH] [RESEND] usb: xhci: tegra: mark PM functions as __maybe_unused Arnd Bergmann
@ 2021-10-05 11:06 ` Greg Kroah-Hartman
  2021-10-05 11:13   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-05 11:06 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mathias Nyman, Thierry Reding, Jonathan Hunter, JC Kuo,
	Arnd Bergmann, Yang Yingliang, Petr Mladek, Andy Shevchenko,
	linux-usb, linux-tegra, linux-kernel

On Mon, Sep 27, 2021 at 04:22:52PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The added #ifdefs in the PM rework were almost correct, but still
> cause warnings in some randconfig builds:
> 
> drivers/usb/host/xhci-tegra.c:2147:12: error: 'tegra_xusb_resume' defined but not used [-Werror=unused-function]
>  2147 | static int tegra_xusb_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~
> drivers/usb/host/xhci-tegra.c:2105:12: error: 'tegra_xusb_suspend' defined but not used [-Werror=unused-function]
>  2105 | static int tegra_xusb_suspend(struct device *dev)
> 
> Replace the #ifdef checks with simpler __maybe_unused annotations to
> reliably shut up these warnings.
> 
> Fixes: d64d362f1d8b ("usb: xhci: tegra: Enable ELPG for runtime/system PM")

What tree does this commit come in from?  I don't see it in my usb tree
:(

thanks,

greg k-h

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

* Re: [PATCH] [RESEND] usb: xhci: tegra: mark PM functions as __maybe_unused
  2021-10-05 11:06 ` Greg Kroah-Hartman
@ 2021-10-05 11:13   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-10-05 11:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Thierry Reding, Jonathan Hunter, JC Kuo,
	Arnd Bergmann, Yang Yingliang, Petr Mladek, Andy Shevchenko,
	USB list, open list:TEGRA ARCHITECTURE SUPPORT,
	Linux Kernel Mailing List

On Tue, Oct 5, 2021 at 1:07 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Mon, Sep 27, 2021 at 04:22:52PM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The added #ifdefs in the PM rework were almost correct, but still
> > cause warnings in some randconfig builds:
> >
> > drivers/usb/host/xhci-tegra.c:2147:12: error: 'tegra_xusb_resume' defined but not used [-Werror=unused-function]
> >  2147 | static int tegra_xusb_resume(struct device *dev)
> >       |            ^~~~~~~~~~~~~~~~~
> > drivers/usb/host/xhci-tegra.c:2105:12: error: 'tegra_xusb_suspend' defined but not used [-Werror=unused-function]
> >  2105 | static int tegra_xusb_suspend(struct device *dev)
> >
> > Replace the #ifdef checks with simpler __maybe_unused annotations to
> > reliably shut up these warnings.
> >
> > Fixes: d64d362f1d8b ("usb: xhci: tegra: Enable ELPG for runtime/system PM")
>
> What tree does this commit come in from?  I don't see it in my usb tree
> :(

I don't know, I originally created the patch back in April when the
problem first
showed up in my randconfig build tree, and picked up the commit now when I saw
the bug still exists in v5.15-rc.

Apparently the commit ID that has made it into mainline through your tree was
971ee247060d ("usb: xhci: tegra: Enable ELPG for runtime/system PM").
I'll resend with that reference fixed.

      Arnd

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

end of thread, other threads:[~2021-10-05 11:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 14:22 [PATCH] [RESEND] usb: xhci: tegra: mark PM functions as __maybe_unused Arnd Bergmann
2021-10-05 11:06 ` Greg Kroah-Hartman
2021-10-05 11:13   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.