linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: qcom: mark PM functions as __maybe_unused
@ 2018-05-25 16:06 Arnd Bergmann
  2018-05-30 23:00 ` Doug Anderson
  2018-06-06 11:26 ` Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-05-25 16:06 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Manu Gautam, linux-usb, linux-kernel

The #ifdef guards around these are wrong, resulting in warnings
in certain configurations:

drivers/usb/dwc3/dwc3-qcom.c:244:12: error: 'dwc3_qcom_resume' defined but not used [-Werror=unused-function]
 static int dwc3_qcom_resume(struct dwc3_qcom *qcom)
            ^~~~~~~~~~~~~~~~
drivers/usb/dwc3/dwc3-qcom.c:223:12: error: 'dwc3_qcom_suspend' defined but not used [-Werror=unused-function]
 static int dwc3_qcom_suspend(struct dwc3_qcom *qcom)

This replaces the guards with __maybe_unused annotations to shut up
the warnings and give better compile time coverage.

Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/dwc3/dwc3-qcom.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 8abb6f31389d..d7a4728b48d5 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -548,8 +548,7 @@ static int dwc3_qcom_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int dwc3_qcom_pm_suspend(struct device *dev)
+static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev)
 {
 	struct dwc3_qcom *qcom = dev_get_drvdata(dev);
 	int ret = 0;
@@ -561,7 +560,7 @@ static int dwc3_qcom_pm_suspend(struct device *dev)
 	return ret;
 }
 
-static int dwc3_qcom_pm_resume(struct device *dev)
+static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev)
 {
 	struct dwc3_qcom *qcom = dev_get_drvdata(dev);
 	int ret;
@@ -572,23 +571,20 @@ static int dwc3_qcom_pm_resume(struct device *dev)
 
 	return ret;
 }
-#endif
 
-#ifdef CONFIG_PM
-static int dwc3_qcom_runtime_suspend(struct device *dev)
+static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev)
 {
 	struct dwc3_qcom *qcom = dev_get_drvdata(dev);
 
 	return dwc3_qcom_suspend(qcom);
 }
 
-static int dwc3_qcom_runtime_resume(struct device *dev)
+static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev)
 {
 	struct dwc3_qcom *qcom = dev_get_drvdata(dev);
 
 	return dwc3_qcom_resume(qcom);
 }
-#endif
 
 static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume)
-- 
2.9.0

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

* Re: [PATCH] usb: dwc3: qcom: mark PM functions as __maybe_unused
  2018-05-25 16:06 [PATCH] usb: dwc3: qcom: mark PM functions as __maybe_unused Arnd Bergmann
@ 2018-05-30 23:00 ` Doug Anderson
  2018-06-06 11:26 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2018-05-30 23:00 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Felipe Balbi, Greg Kroah-Hartman, Manu Gautam, linux-usb, LKML

Hi,

On Fri, May 25, 2018 at 9:06 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> The #ifdef guards around these are wrong, resulting in warnings
> in certain configurations:
>
> drivers/usb/dwc3/dwc3-qcom.c:244:12: error: 'dwc3_qcom_resume' defined but not used [-Werror=unused-function]
>  static int dwc3_qcom_resume(struct dwc3_qcom *qcom)
>             ^~~~~~~~~~~~~~~~
> drivers/usb/dwc3/dwc3-qcom.c:223:12: error: 'dwc3_qcom_suspend' defined but not used [-Werror=unused-function]
>  static int dwc3_qcom_suspend(struct dwc3_qcom *qcom)
>
> This replaces the guards with __maybe_unused annotations to shut up
> the warnings and give better compile time coverage.
>
> Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/usb/dwc3/dwc3-qcom.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

FWIW:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* Re: [PATCH] usb: dwc3: qcom: mark PM functions as __maybe_unused
  2018-05-25 16:06 [PATCH] usb: dwc3: qcom: mark PM functions as __maybe_unused Arnd Bergmann
  2018-05-30 23:00 ` Doug Anderson
@ 2018-06-06 11:26 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2018-06-06 11:26 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Felipe Balbi, Greg Kroah-Hartman, Manu Gautam, USB list,
	Linux Kernel Mailing List

On Fri, May 25, 2018 at 6:06 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The #ifdef guards around these are wrong, resulting in warnings
> in certain configurations:
>
> drivers/usb/dwc3/dwc3-qcom.c:244:12: error: 'dwc3_qcom_resume' defined but not used [-Werror=unused-function]
>  static int dwc3_qcom_resume(struct dwc3_qcom *qcom)
>             ^~~~~~~~~~~~~~~~
> drivers/usb/dwc3/dwc3-qcom.c:223:12: error: 'dwc3_qcom_suspend' defined but not used [-Werror=unused-function]
>  static int dwc3_qcom_suspend(struct dwc3_qcom *qcom)
>
> This replaces the guards with __maybe_unused annotations to shut up
> the warnings and give better compile time coverage.
>
> Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2018-06-06 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-25 16:06 [PATCH] usb: dwc3: qcom: mark PM functions as __maybe_unused Arnd Bergmann
2018-05-30 23:00 ` Doug Anderson
2018-06-06 11:26 ` Geert Uytterhoeven

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