Skip to contentSkip to conversation

usb: cdns3: Fixed kernel test robot warning

PATCH In review Souptick Joarder 4 participants 4 messages Dec 9, 2020 – Dec 10, 2020

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

PATCH 1/1 usb: cdns3: Fixed kernel test robot warning

Kernel test robot throws below warning ->

In file included from drivers/usb/cdns3/core.c:23:

Quoted 3 lines
Quoted 3 lines

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

27 | static inline int xhci_cdns3_suspend_quirk(struct usb_hcd
*hcd)
| ^~~~~~~

This patch will silence it.

---
 drivers/usb/cdns3/host-export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/cdns3/host-export.h +1 -1
index fb8541b..c1259af 100644
@@ -24,7 +24,7 @@ static inline int cdns_host_init(struct cdns *cdns)
 }
 
 static inline void cdns_host_exit(struct cdns *cdns) { }
-static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
+static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
 {
 	return 0;
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 11 lines · Souptick Joarder

Kernel test robot throws below warning ->

In file included from drivers/usb/cdns3/core.c:23:

Quoted 3 lines
Quoted 3 lines

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

27 | static inline int xhci_cdns3_suspend_quirk(struct usb_hcd
*hcd)
| ^~~~~~~

This patch will silence it.

Really? Didn't silence it for me when I tested this patch.

Also, please see

https://lore.kernel.org/linux-usb/DBBPR04MB7979502194410BB1AE96DF038BCC0@DBBPR04MB7979.eurprd04.prod.outlook.com/T/#m7f73fdd57c0f1577fb610dcaf28646b53fa7dc26

(what a strange URL)

I now get these 2 warnings:

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

                                            ^~~~~~~
  CC [M]  drivers/usb/gadget/function/uvc_queue.o
../drivers/usb/cdns3/host-export.h:27:12: warning: ‘xhci_cdns3_suspend_quirk’ defined but not used [-Wunused-function]
 static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
            ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 20 lines
---
 drivers/usb/cdns3/host-export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/cdns3/host-export.h +1 -1
index fb8541b..c1259af 100644
@@ -24,7 +24,7 @@ static inline int cdns_host_init(struct cdns *cdns)
 }
 
 static inline void cdns_host_exit(struct cdns *cdns) { }
-static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
+static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
 {
 	return 0;
 }
Signature · 2 lines
~Randy
Reported-by: Randy Dunlap <[email protected]>
maintainer
#2 lore raw
Quoted 30 lines · Souptick Joarder
Quoted 11 lines

Kernel test robot throws below warning ->

In file included from drivers/usb/cdns3/core.c:23:

Quoted 3 lines
Quoted 3 lines

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

27 | static inline int xhci_cdns3_suspend_quirk(struct usb_hcd
*hcd)
| ^~~~~~~

This patch will silence it.

Really? Didn't silence it for me when I tested this patch.

Also, please see

https://urldefense.com/v3/__https://lore.kernel.org/linux-
usb/DBBPR04MB7979502194410BB1AE96DF038BCC0@DBBPR04MB7979.eurprd04.prod.outlook.com/T/*m7f73fdd57c0f1577fb610dc af28646b53fa7dc26__;Iw!!EHscmS1ygiU1lA!XZzHlY6luEH3QepkggEsHS0x7oNNiz0XI9Xey3oIQpfSd1UVQEGzXbgXpfS2Eg$

(what a strange URL)

I now get these 2 warnings:

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

Quoted 6 lines
                                           ^~~~~~~
 CC [M]  drivers/usb/gadget/function/uvc_queue.o
../drivers/usb/cdns3/host-export.h:27:12: warning: ‘xhci_cdns3_suspend_quirk’ defined but not used [-Wunused-function]
static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
           ^~~~~~~~~~~~~~~~~~~~~~~~

The best way for resolving this issue is to remove xhci_cdns3_suspend_quirk from host-export.h file. It's used only in host.c file so it can be declared there as static.

Thanks
Pawel

Quoted 26 lines
Quoted 13 lines
---
 drivers/usb/cdns3/host-export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/cdns3/host-export.h +0 -0
index fb8541b..c1259af 100644

drivers/usb/cdns3/host-export.h static inline int cdns_host_init(struct cdns *cdns) · line 30

Quoted 8 lines
drivers/usb/cdns3/host-export.h +1 -1
@@ -24,7 +24,7 @@ static inline int cdns_host_init(struct cdns *cdns)
 }
 
 static inline void cdns_host_exit(struct cdns *cdns) { }
-static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
+static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
 {
 	return 0;
 }

--
~Randy

maintainer
#3 lore raw
In reply to Souptick Joarder
Quoted 23 lines · Souptick Joarder

Kernel test robot throws below warning ->

In file included from drivers/usb/cdns3/core.c:23:

Quoted 3 lines
Quoted 3 lines

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

27 | static inline int xhci_cdns3_suspend_quirk(struct usb_hcd
*hcd)
| ^~~~~~~

This patch will silence it.

---
 drivers/usb/cdns3/host-export.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/cdns3/host-export.h +0 -0
index fb8541b..c1259af 100644

drivers/usb/cdns3/host-export.h static inline int cdns_host_init(struct cdns *cdns) · line 27

Quoted 5 lines
drivers/usb/cdns3/host-export.h +1 -1
@@ -24,7 +24,7 @@ static inline int cdns_host_init(struct cdns *cdns)
 }
 
 static inline void cdns_host_exit(struct cdns *cdns) { }
-static inline int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
+static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)

That should not change anything for this warning, sorry.