* [PATCH] usb: renesas_usbhs: mark PM functions as __maybe_unused
@ 2018-12-11 10:06 Arnd Bergmann
2018-12-12 2:11 ` Yoshihiro Shimoda
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-12-11 10:06 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Arnd Bergmann, Yoshihiro Shimoda, Felipe Balbi, Simon Horman,
Chris Brandt, linux-usb, linux-kernel
Without CONFIG_PM, we get a new build warning here:
drivers/usb/renesas_usbhs/common.c:860:12: error: 'usbhsc_resume' defined but not used [-Werror=unused-function]
static int usbhsc_resume(struct device *dev)
^~~~~~~~~~~~~
drivers/usb/renesas_usbhs/common.c:844:12: error: 'usbhsc_suspend' defined but not used [-Werror=unused-function]
static int usbhsc_suspend(struct device *dev)
^~~~~~~~~~~~~~
No idea why this never happened before, but it's trivial to work
around by marking the functions as __maybe_unused so the compiler
can silently discard them.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/renesas_usbhs/common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 02c1d2bf4f86..2ff7991f4517 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -841,7 +841,7 @@ static int usbhs_remove(struct platform_device *pdev)
return 0;
}
-static int usbhsc_suspend(struct device *dev)
+static __maybe_unused int usbhsc_suspend(struct device *dev)
{
struct usbhs_priv *priv = dev_get_drvdata(dev);
struct usbhs_mod *mod = usbhs_mod_get_current(priv);
@@ -857,7 +857,7 @@ static int usbhsc_suspend(struct device *dev)
return 0;
}
-static int usbhsc_resume(struct device *dev)
+static __maybe_unused int usbhsc_resume(struct device *dev)
{
struct usbhs_priv *priv = dev_get_drvdata(dev);
struct platform_device *pdev = usbhs_priv_to_pdev(priv);
--
2.20.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] usb: renesas_usbhs: mark PM functions as __maybe_unused
2018-12-11 10:06 [PATCH] usb: renesas_usbhs: mark PM functions as __maybe_unused Arnd Bergmann
@ 2018-12-12 2:11 ` Yoshihiro Shimoda
0 siblings, 0 replies; 2+ messages in thread
From: Yoshihiro Shimoda @ 2018-12-12 2:11 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman
Cc: Felipe Balbi, Simon Horman, Chris Brandt, linux-usb, linux-kernel
Hi Arnd,
Thank you for the patch!
> From: Arnd Bergmann, Sent: Tuesday, December 11, 2018 7:06 PM
> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Arnd Bergmann <arnd@arndb.de>; Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>; Felipe Balbi
> <felipe.balbi@linux.intel.com>; Simon Horman <horms+renesas@verge.net.au>; Chris Brandt <Chris.Brandt@renesas.com>;
> linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] usb: renesas_usbhs: mark PM functions as __maybe_unused
>
> Without CONFIG_PM, we get a new build warning here:
>
> drivers/usb/renesas_usbhs/common.c:860:12: error: 'usbhsc_resume' defined but not used [-Werror=unused-function]
> static int usbhsc_resume(struct device *dev)
> ^~~~~~~~~~~~~
> drivers/usb/renesas_usbhs/common.c:844:12: error: 'usbhsc_suspend' defined but not used [-Werror=unused-function]
> static int usbhsc_suspend(struct device *dev)
> ^~~~~~~~~~~~~~
>
> No idea why this never happened before, but it's trivial to work
> around by marking the functions as __maybe_unused so the compiler
> can silently discard them.
This build warning cause the commit d54d334e75b9 ("usb: renesas_usbhs:
Use SIMPLE_DEV_PM_OPS macro").
So, I'd like to add the following tag on this commit log.
Fixes: d54d334e75b9 ("usb: renesas_usbhs: Use SIMPLE_DEV_PM_OPS macro")
Also, we can remove "No idea why this never happened before, but"
from the commit log.
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
After revised the commit log a little:
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Best regards,
Yoshihiro Shimoda
> ---
> drivers/usb/renesas_usbhs/common.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index 02c1d2bf4f86..2ff7991f4517 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -841,7 +841,7 @@ static int usbhs_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static int usbhsc_suspend(struct device *dev)
> +static __maybe_unused int usbhsc_suspend(struct device *dev)
> {
> struct usbhs_priv *priv = dev_get_drvdata(dev);
> struct usbhs_mod *mod = usbhs_mod_get_current(priv);
> @@ -857,7 +857,7 @@ static int usbhsc_suspend(struct device *dev)
> return 0;
> }
>
> -static int usbhsc_resume(struct device *dev)
> +static __maybe_unused int usbhsc_resume(struct device *dev)
> {
> struct usbhs_priv *priv = dev_get_drvdata(dev);
> struct platform_device *pdev = usbhs_priv_to_pdev(priv);
> --
> 2.20.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-12 2:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 10:06 [PATCH] usb: renesas_usbhs: mark PM functions as __maybe_unused Arnd Bergmann
2018-12-12 2:11 ` Yoshihiro Shimoda
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®