All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: hide unused usbfs_notify_suspend/resume functions
@ 2023-05-16 20:17 Arnd Bergmann
  2023-05-16 20:44 ` Sebastian Reichel
  2023-05-16 20:53 ` Alan Stern
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-05-16 20:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern
  Cc: Arnd Bergmann, Sebastian Reichel, Andrew Morton, linux-usb,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/core/devio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index e501a03d6c70..1622ad35428d 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -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",
-- 
2.39.2


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

end of thread, other threads:[~2023-05-16 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 20:17 [PATCH] usb: hide unused usbfs_notify_suspend/resume functions Arnd Bergmann
2023-05-16 20:44 ` Sebastian Reichel
2023-05-16 20:53 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.