[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160906132318.2033811-1-arnd@arndb.de>
Date: Tue, 6 Sep 2016 15:23:10 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Arnd Bergmann <arnd@...db.de>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
John Youn <John.Youn@...opsys.com>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH for v4.8] usb: dwc3: mark PM function as __maybe_unused
Starting with v4.8-rc5, we get a warning about the dwc3_pci_pm_dummy function
when CONFIG_PM_SLEEP is disabled:
drivers/usb/dwc3/dwc3-pci.c:253:12: warning: 'dwc3_pci_pm_dummy' defined but not used
Using __maybe_unused instead of #ifdef lets the compiler figure out
whether it should drop the definitions silently and avoids this warning.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
Fixes: f6c274e11e3b ("usb: dwc3: pci: runtime_resume child device")
---
drivers/usb/dwc3/dwc3-pci.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
After we fixed all other warnings reported by kernelci.org, this is
now the only thing we get a warning for in the configurations we build,
so it would be good to get this fixed before v4.8 to get a clean
build for the first time in a release.
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 0a32430f4c41..6a82b36f0d59 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -234,8 +234,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
};
MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
-#ifdef CONFIG_PM
-static int dwc3_pci_runtime_suspend(struct device *dev)
+static int __maybe_unused dwc3_pci_runtime_suspend(struct device *dev)
{
if (device_run_wake(dev))
return 0;
@@ -243,14 +242,14 @@ static int dwc3_pci_runtime_suspend(struct device *dev)
return -EBUSY;
}
-static int dwc3_pci_runtime_resume(struct device *dev)
+static int __maybe_unused dwc3_pci_runtime_resume(struct device *dev)
{
struct platform_device *dwc3 = dev_get_drvdata(dev);
return pm_runtime_get(&dwc3->dev);
}
-static int dwc3_pci_pm_dummy(struct device *dev)
+static int __maybe_unused dwc3_pci_pm_dummy(struct device *dev)
{
/*
* There's nothing to do here. No, seriously. Everything is either taken
@@ -262,7 +261,6 @@ static int dwc3_pci_pm_dummy(struct device *dev)
*/
return 0;
}
-#endif /* CONFIG_PM */
static struct dev_pm_ops dwc3_pci_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy)
--
2.9.0
Powered by blists - more mailing lists