usb: cdns3: include host-export,h for cdns3_host_init
Subsystems (3)
PATCH 1/1 usb: cdns3: include host-export,h for cdns3_host_init
The cdns3_host_init() function is declared in host-export.h but host.c does not include it. Add the include to have the declaration present (and remove the declaration of cdns3_host_exit which is now static).
Fixes the following sparse warning:
drivers/usb/cdns3/host.c:58:5: warning: symbol 'cdns3_host_init' was not declared. Should it be static?
---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: "Ben Dooks
Cc: [email protected]
--- drivers/usb/cdns3/host-export.h | 1 - drivers/usb/cdns3/host.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/usb/cdns3/host-export.h +0 -1
@@ -12,7 +12,6 @@#ifdef CONFIG_USB_CDNS3_HOST int cdns3_host_init (struct cdns3 *cdns); -void cdns3_host_exit (struct cdns3 *cdns);#else
drivers/usb/cdns3/host.c +1 -0
@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include "core.h" #include "drd.h" +#include "host-export.h" static int __cdns3_host_init (struct cdns3 *cdns) {
Signature · 1 line
2.23.0
Pawel Laszczak
maintainerHi
Quoted 8 lines
The
cdns3_host_init()function is declared inhost-export.hbuthost.cdoes not include it. Add the include to have the declaration present (and remove the declaration ofcdns3_host_exitwhich is now static).Fixes the following sparse warning:
drivers/usb/cdns3/host.c:58:5: warning: symbol 'cdns3_host_init' was not declared. Should it be static?
It should not be static. It can be called from core.c file.
It will be static only if CONFIG_USB_CDNS3_HOST will not be defined and in this case function will be declared in host-export.h as static.
For me It doesn't look like driver issue.
Quoted 18 lines
Signed-off-by Ben Dooks <[email protected]>---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: "Ben Dooks
Cc: [email protected]
---drivers/usb/cdns3/host-export.h| 1 -drivers/usb/cdns3/host.c| 1 +2 files changed, 1 insertion(+), 1 deletion(-)drivers/usb/cdns3/host-export.h +0
-0
drivers/usb/cdns3/host-export.h line 15
Quoted 4 lines
drivers/usb/cdns3/host-export.h +0
-1@@ -12,7 +12,6 @@#ifdef CONFIG_USB_CDNS3_HOST int cdns3_host_init (struct cdns3 *cdns); -void cdns3_host_exit (struct cdns3 *cdns);
We can't remove this function. It is invoked from core.c file. If you remove it from host-export.h then it will not be visible there.
drivers/usb/cdns3/host.c line 15
Quoted 12 lines
drivers/usb/cdns3/host-export.h +0
-0#else drivers/usb/cdns3/host.c +1
-0@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include "core.h" #include "drd.h" +#include "host-export.h"
Why host must include this file. This function is implemented In host.c and is used only in core.c file .
Quoted 5 lines
drivers/usb/cdns3/host.c +0
-1static int __cdns3_host_init (struct cdns3 *cdns) { --2.23.0
Regards,
Pawell
Quoted 7 lines · Pawel Laszczak
Hi
Quoted 5 lines
The
cdns3_host_init()function is declared inhost-export.hbuthost.cdoes not include it. Add the include to have the declaration present (and remove the declaration ofcdns3_host_exitwhich is now static).
Quoted 7 lines
Quoted 3 lines
Fixes the following sparse warning:
drivers/usb/cdns3/host.c:58:5: warning: symbol 'cdns3_host_init' was not declared. Should it be static?It should not be static. It can be called from
core.cfile.
It will be static only ifCONFIG_USB_CDNS3_HOSTwill not be defined and in this case function will be declared inhost-export.has static.
I know, this isn't being made static, that's a warning.
Quoted 31 lines
For me It doesn't look like driver issue.
Quoted 18 lines
Signed-off-by Ben Dooks <[email protected]>---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: "Ben Dooks
Cc: [email protected]
---drivers/usb/cdns3/host-export.h| 1 -drivers/usb/cdns3/host.c| 1 +2 files changed, 1 insertion(+), 1 deletion(-)drivers/usb/cdns3/host-export.h +0
-0drivers/usb/cdns3/host-export.h line 15
Quoted 4 lines
drivers/usb/cdns3/host-export.h +0
-1@@ -12,7 +12,6 @@#ifdef CONFIG_USB_CDNS3_HOST int cdns3_host_init (struct cdns3 *cdns); -void cdns3_host_exit (struct cdns3 *cdns);We can't remove this function. It is invoked from
core.cfile. If you remove it fromhost-export.hthen it will not be visible there.Quoted 3 lines
drivers/usb/cdns3/host-export.h +0
-0#else
Quoted 12 lines
drivers/usb/cdns3/host.c line 15
Quoted 9 lines
drivers/usb/cdns3/host.c +1
-0@@ -12,6 +12,7 @@#include <linux/platform_device.h> #include "core.h" #include "drd.h" +#include "host-export.h" Why host must include this file. This function is implemented In
host.cand is used only incore.cfile .
The implementation should also have the declaration to ensure that the implemented function matches the declared prototype in the header
Signature · 4 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html