Skip to contentSkip to conversation

usb: hide unused usbfs_notify_suspend/resume functions

PATCH In review Arnd Bergmann 3 participants 3 messages May 16, 2023 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: hide unused usbfs_notify_suspend/resume functions

From: Arnd Bergmann <[email protected]>

The declaration is in an #ifdef, which causes warnings when building with 'make W=1' and without CONFIG_PM:

drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume'

Use the same #ifdef check around the function definitions to avoid the warnings and slightly shrink the USB core.

Fixes 7794f486ed0b ("usbfs: Add ioctls for runtime power management")
---
 drivers/usb/core/devio.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/core/devio.c +2 -0
index e501a03d6c70..1622ad35428d 100644
@@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 /* The following routines apply to the entire device, not interfaces */
 void usbfs_notify_suspend(struct usb_device *udev)
 {
@@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev)
 	}
 	mutex_unlock(&usbfs_mutex);
 }
+#endif
 
 struct usb_driver usbfs_driver = {
 	.name =		"usbfs",
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The declaration is in an #ifdef, which causes warnings when building with 'make W=1' and without CONFIG_PM:

drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume'

Quoted 6 lines

Use the same #ifdef check around the function definitions to avoid the warnings and slightly shrink the USB core.

Fixes 7794f486ed0b ("usbfs: Add ioctls for runtime power management")

---

I have no clue why I'm CC'd, but patch LGTM:

-- Sebastian

Quoted 26 lines
 drivers/usb/core/devio.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/core/devio.c +2 -0
index e501a03d6c70..1622ad35428d 100644
@@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 /* The following routines apply to the entire device, not interfaces */
 void usbfs_notify_suspend(struct usb_device *udev)
 {
@@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev)
 	}
 	mutex_unlock(&usbfs_mutex);
 }
+#endif
 
 struct usb_driver usbfs_driver = {
 	.name =		"usbfs",
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The declaration is in an #ifdef, which causes warnings when building with 'make W=1' and without CONFIG_PM:

drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend' drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume'

Quoted 6 lines

Use the same #ifdef check around the function definitions to avoid the warnings and slightly shrink the USB core.

Fixes 7794f486ed0b ("usbfs: Add ioctls for runtime power management")

---

Quoted 26 lines
 drivers/usb/core/devio.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/core/devio.c +2 -0
index e501a03d6c70..1622ad35428d 100644
@@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 /* The following routines apply to the entire device, not interfaces */
 void usbfs_notify_suspend(struct usb_device *udev)
 {
@@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev)
 	}
 	mutex_unlock(&usbfs_mutex);
 }
+#endif
 
 struct usb_driver usbfs_driver = {
 	.name =		"usbfs",
Signature · 1 line
2.39.2