Skip to contentSkip to conversation

usb: cdns3: fix warning when USB_CDNS_HOST is not set

PATCH Applied Randy Dunlap 2 participants 2 messages Dec 8, 2020 – Dec 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: cdns3: fix warning when USB_CDNS_HOST is not set

Fix a build warning when USB_CDNS_HOST is not enabled:

In file included from ../drivers/usb/cdns3/core.c:23:0:
../drivers/usb/cdns3/host-export.h:27:51: warning: ‘struct usb_hcd’ declared inside parameter list will not be visible outside of this definition or declaration
static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)

                                                   ^~~~~~~
Cc Peter Chen <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc Roger Quadros <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/cdns3/host-export.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/cdns3/host-export.h +2 -2
@@ -9,10 +9,10 @@
 #ifndef __LINUX_CDNS3_HOST_EXPORT
 #define __LINUX_CDNS3_HOST_EXPORT
 
-#if IS_ENABLED(CONFIG_USB_CDNS_HOST)
-
 struct usb_hcd;
 
+#if IS_ENABLED(CONFIG_USB_CDNS_HOST)
+
 int cdns_host_init(struct cdns *cdns);
 int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd);
 
Applied
#1 lore raw
Quoted 7 lines

In file included from ../drivers/usb/cdns3/core.c:23:0:
../drivers/usb/cdns3/host-export.h:27:51: warning: ‘struct usb_hcd’ declared inside parameter list will not be visible outside of this definition or declaration static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)

                                                   ^~~~~~~

Applied both, thanks.

Peter

Quoted 25 lines
Cc Peter Chen <[email protected]>
Cc Pawel Laszczak <[email protected]>
Cc Roger Quadros <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/cdns3/host-export.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/cdns3/host-export.h +2 -2
@@ -9,10 +9,10 @@
 #ifndef __LINUX_CDNS3_HOST_EXPORT
 #define __LINUX_CDNS3_HOST_EXPORT
 
-#if IS_ENABLED(CONFIG_USB_CDNS_HOST)
-
 struct usb_hcd;
 
+#if IS_ENABLED(CONFIG_USB_CDNS_HOST)
+
 int cdns_host_init(struct cdns *cdns);
 int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd);