diff mbox series

[-next] usb: renesas_usbhs: Fix unused function warning when CONFIG_PM not set

Message ID 20181213031924.12216-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] usb: renesas_usbhs: Fix unused function warning when CONFIG_PM not set | expand

Commit Message

Yue Haibing Dec. 13, 2018, 3:19 a.m. UTC
with CONFIG_PM not set, gcc warning this:
drivers/usb/renesas_usbhs/common.c:844:12:
 warning: 'usbhsc_suspend' defined but not used [-Wunused-function]
drivers/usb/renesas_usbhs/common.c:860:12:
 warning: 'usbhsc_resume' defined but not used [-Wunused-function]

fix this by adding #ifdef around it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/usb/renesas_usbhs/common.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Yoshihiro Shimoda Dec. 13, 2018, 3:41 a.m. UTC | #1
Hi,

> From: YueHaibing, Sent: Thursday, December 13, 2018 12:19 PM
> 
> with CONFIG_PM not set, gcc warning this:
> drivers/usb/renesas_usbhs/common.c:844:12:
>  warning: 'usbhsc_suspend' defined but not used [-Wunused-function]
> drivers/usb/renesas_usbhs/common.c:860:12:
>  warning: 'usbhsc_resume' defined but not used [-Wunused-function]
> 
> fix this by adding #ifdef around it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thank you for the patch.
However, this issue is already fixed on the Greg's usb.git / usb-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-next&id=eaf3074e0a8c2a39c4c14aa8ef1c2ec09ace9c79

Best regards,
Yoshihiro Shimoda
diff mbox series

Patch

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 02c1d2b..9390c76 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -841,6 +841,7 @@  static int usbhs_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 static int usbhsc_suspend(struct device *dev)
 {
 	struct usbhs_priv *priv = dev_get_drvdata(dev);
@@ -873,6 +874,7 @@  static int usbhsc_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(usbhsc_pm_ops, usbhsc_suspend, usbhsc_resume);