usb: cdns3: Fixed kernel test robot warning
Subsystems (3)
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: 'structusb_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
@@ -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
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: 'structusb_hcd' declared inside parameter list will not be visible outside of this definition or declaration27 | 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
(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
Reported-by kernel test robot <[email protected]>Signed-off-by Souptick Joarder <[email protected]>--- drivers/usb/cdns3/host-export.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)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 ; }
Signature · 2 lines
~Randy Reported-by: Randy Dunlap <[email protected]>
Pawel Laszczak
maintainerQuoted 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: 'structusb_hcd' declared inside parameter list will not be visible outside of this definition or declaration27 | 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 intxhci_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
Reported-by kernel test robot <[email protected]>Signed-off-by Souptick Joarder <[email protected]>--- drivers/usb/cdns3/host-export.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/cdns3/host-export.h +0
-0drivers/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 ; }--
~RandyReported-by Randy Dunlap <[email protected]>
Greg KH
maintainerQuoted 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: 'structusb_hcd' declared inside parameter list will not be visible outside of this definition or declaration27 | static inline int xhci_cdns3_suspend_quirk(struct
usb_hcd
*hcd)
| ^~~~~~~This patch will silence it.
Reported-by kernel test robot <[email protected]>Signed-off-by Souptick Joarder <[email protected]>--- drivers/usb/cdns3/host-export.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/cdns3/host-export.h +0
-0
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.