[U-Boot] [PATCH 1/2] usb: host: xhci-omap: fix build break

Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com --- drivers/usb/host/xhci-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c index 104e7a7282cf..fd19f79f0fc5 100644 --- a/drivers/usb/host/xhci-omap.c +++ b/drivers/usb/host/xhci-omap.c @@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
static struct omap_xhci omap;
-inline int __board_usb_init(int index, enum usb_init_type init) +__weak int __board_usb_init(int index, enum usb_init_type init) { return 0; }

fix the following build warnings:
drivers/usb/dwc3/core.c: In function ‘dwc3_uboot_init’: drivers/usb/dwc3/core.c:625:6: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); ^ drivers/usb/dwc3/dwc3-omap.c: In function ‘dwc3_omap_uboot_init’: drivers/usb/dwc3/dwc3-omap.c:380:7: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
Signed-off-by: Felipe Balbi balbi@ti.com --- drivers/usb/dwc3/core.c | 2 +- drivers/usb/dwc3/dwc3-omap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index ab3c94e51275..a95d461a7cc4 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -613,7 +613,7 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc) int dwc3_uboot_init(struct dwc3_device *dwc3_dev) { struct dwc3 *dwc; - struct device *dev; + struct device *dev = NULL; u8 lpm_nyet_threshold; u8 tx_de_emphasis; u8 hird_threshold; diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index ac9a856190f0..3dcc2f484777 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -374,7 +374,7 @@ static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap, int utmi_mode) int dwc3_omap_uboot_init(struct dwc3_omap_device *omap_dev) { u32 reg; - struct device *dev; + struct device *dev = NULL; struct dwc3_omap *omap;
omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);

Felipe Balbi balbi@ti.com writes:
fix the following build warnings:
drivers/usb/dwc3/core.c: In function ‘dwc3_uboot_init’: drivers/usb/dwc3/core.c:625:6: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); ^ drivers/usb/dwc3/dwc3-omap.c: In function ‘dwc3_omap_uboot_init’: drivers/usb/dwc3/dwc3-omap.c:380:7: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
Signed-off-by: Felipe Balbi balbi@ti.com
ping
drivers/usb/dwc3/core.c | 2 +- drivers/usb/dwc3/dwc3-omap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index ab3c94e51275..a95d461a7cc4 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -613,7 +613,7 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc) int dwc3_uboot_init(struct dwc3_device *dwc3_dev) { struct dwc3 *dwc;
- struct device *dev;
- struct device *dev = NULL; u8 lpm_nyet_threshold; u8 tx_de_emphasis; u8 hird_threshold;
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index ac9a856190f0..3dcc2f484777 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -374,7 +374,7 @@ static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap, int utmi_mode) int dwc3_omap_uboot_init(struct dwc3_omap_device *omap_dev) { u32 reg;
- struct device *dev;
struct device *dev = NULL; struct dwc3_omap *omap;
omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
-- 2.5.3

On Friday, October 16, 2015 at 10:09:19 PM, Felipe Balbi wrote:
Felipe Balbi balbi@ti.com writes:
fix the following build warnings:
drivers/usb/dwc3/core.c: In function ‘dwc3_uboot_init’: drivers/usb/dwc3/core.c:625:6: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
^
drivers/usb/dwc3/dwc3-omap.c: In function ‘dwc3_omap_uboot_init’: drivers/usb/dwc3/dwc3-omap.c:380:7: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized] omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
Signed-off-by: Felipe Balbi balbi@ti.com
ping
I'd be really helpful if you CCed me ;)
Best regards, Marek Vasut

Felipe Balbi balbi@ti.com writes:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
ping
drivers/usb/host/xhci-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c index 104e7a7282cf..fd19f79f0fc5 100644 --- a/drivers/usb/host/xhci-omap.c +++ b/drivers/usb/host/xhci-omap.c @@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
static struct omap_xhci omap;
-inline int __board_usb_init(int index, enum usb_init_type init) +__weak int __board_usb_init(int index, enum usb_init_type init) { return 0; } -- 2.5.3

On Fri, Oct 16, 2015 at 03:09:02PM -0500, Felipe Balbi wrote:
Felipe Balbi balbi@ti.com writes:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
ping
Where / how do I trigger this (or 2/2) ?

Tom Rini trini@konsulko.com writes:
On Fri, Oct 16, 2015 at 03:09:02PM -0500, Felipe Balbi wrote:
Felipe Balbi balbi@ti.com writes:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
ping
Where / how do I trigger this (or 2/2) ?
GCC 5

Felipe Balbi balbi@ti.com writes:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
ping
Where / how do I trigger this (or 2/2) ?
GCC 5
I'm seeing exactly the same issue with gcc5 on Fedora, I've also seen another issue with gcc5 with strcat for panda board variant names which we hacked around [1].
Peter
[1] http://pkgs.fedoraproject.org/cgit/uboot-tools.git/tree/0009-ARM-fix-pandabo...

On Wed, Oct 21, 2015 at 09:37:13AM +0100, Peter Robinson wrote:
Felipe Balbi balbi@ti.com writes:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
ping
Where / how do I trigger this (or 2/2) ?
GCC 5
I'm seeing exactly the same issue with gcc5 on Fedora, I've also seen another issue with gcc5 with strcat for panda board variant names which we hacked around [1].
So, I want to say that GCC 5.x (or at least 5.1) will be a known good compiler for v2016.01. I know that Fedora folks have been doing it for a while (yay, thanks) but I also know that Felipe has seen a few problems using some other (I think..) gcc-5 toolchain. So what I'm doing is getting the Fedora gcc-5 packages installed now, along with a Debian/unstable chroot where I can also get at all of their cross tools.
[1] http://pkgs.fedoraproject.org/cgit/uboot-tools.git/tree/0009-ARM-fix-pandabo...
That's interesting. I don't know why (and I would worry about) strcat failing, but since it's two string literals can't we just do a simple +? Or is my lack of coffee just yet causing me to forget that C is not every-other-language...

On Wed, Oct 21, 2015 at 12:55 PM, Tom Rini trini@konsulko.com wrote:
On Wed, Oct 21, 2015 at 09:37:13AM +0100, Peter Robinson wrote:
Felipe Balbi balbi@ti.com writes:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
ping
Where / how do I trigger this (or 2/2) ?
GCC 5
I'm seeing exactly the same issue with gcc5 on Fedora, I've also seen another issue with gcc5 with strcat for panda board variant names which we hacked around [1].
So, I want to say that GCC 5.x (or at least 5.1) will be a known good compiler for v2016.01. I know that Fedora folks have been doing it for a while (yay, thanks) but I also know that Felipe has seen a few problems using some other (I think..) gcc-5 toolchain. So what I'm doing is getting the Fedora gcc-5 packages installed now, along with a Debian/unstable chroot where I can also get at all of their cross tools.
[1] http://pkgs.fedoraproject.org/cgit/uboot-tools.git/tree/0009-ARM-fix-pandabo...
That's interesting. I don't know why (and I would worry about) strcat failing, but since it's two string literals can't we just do a simple +? Or is my lack of coffee just yet causing me to forget that C is not every-other-language...
It's more pointing it out that it worked for gcc < 5 and we saw this regression with u-boot (numerous versions) built with gcc5, I'm not sure why the panda board implementation did it like it did as opposed to any other way, just worth looking out for those sorts of issues elsewhere in the code.
Peter

On Wed, Oct 21, 2015 at 01:24:42PM +0100, Peter Robinson wrote:
On Wed, Oct 21, 2015 at 12:55 PM, Tom Rini trini@konsulko.com wrote:
On Wed, Oct 21, 2015 at 09:37:13AM +0100, Peter Robinson wrote:
Felipe Balbi balbi@ti.com writes: > Fix the following build break: > > drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ > int board_usb_init(int index, enum usb_init_type init) > ^ > > Signed-off-by: Felipe Balbi balbi@ti.com
ping
Where / how do I trigger this (or 2/2) ?
GCC 5
I'm seeing exactly the same issue with gcc5 on Fedora, I've also seen another issue with gcc5 with strcat for panda board variant names which we hacked around [1].
So, I want to say that GCC 5.x (or at least 5.1) will be a known good compiler for v2016.01. I know that Fedora folks have been doing it for a while (yay, thanks) but I also know that Felipe has seen a few problems using some other (I think..) gcc-5 toolchain. So what I'm doing is getting the Fedora gcc-5 packages installed now, along with a Debian/unstable chroot where I can also get at all of their cross tools.
[1] http://pkgs.fedoraproject.org/cgit/uboot-tools.git/tree/0009-ARM-fix-pandabo...
That's interesting. I don't know why (and I would worry about) strcat failing, but since it's two string literals can't we just do a simple +? Or is my lack of coffee just yet causing me to forget that C is not every-other-language...
It's more pointing it out that it worked for gcc < 5 and we saw this regression with u-boot (numerous versions) built with gcc5, I'm not sure why the panda board implementation did it like it did as opposed to any other way, just worth looking out for those sorts of issues elsewhere in the code.
OK, pulling up strcat(3) and I agree the current code is not correct. And a quick git grep shows that's the only abuse. I see the patch in question in my queue so I'll make sure to apply it. Thanks!

On Thursday, October 01, 2015 at 09:22:17 PM, Felipe Balbi wrote:
Fix the following build break:
drivers/usb/host/xhci-omap.c:35:5: error: ‘board_usb_init’ aliased to external symbol ‘__board_usb_init’ int board_usb_init(int index, enum usb_init_type init) ^
Signed-off-by: Felipe Balbi balbi@ti.com
Applied both, thanks!
Best regards, Marek Vasut
participants (4)
-
Felipe Balbi
-
Marek Vasut
-
Peter Robinson
-
Tom Rini