image: Fix typo in boot_get_kbd()
PATCH v2 1/2 image: Fix typo in boot_get_kbd()
After the commit 4ed37abc49c2 ("image: Remove ifdefs around image_setup_linux() el at"):
common/image-board.c: In function ‘boot_get_kbd’:common/image-board.c:902:17: error: expected ‘)’ before ‘do_bdinfo’
902 | do_bdinfo(NULL, 0, 0, NULL);
| ^~~~~~~~~common/image-board.c:901:12: note: to match this ‘(’
901 | if (IS_ENABLED(CONFIG_CMD_BDI)
| ^common/image-board.c:906:1: error: expected expression before ‘}’ token
906 | }
| ^
common/image-board.c:906:1: warning: control reaches end of non-void function [-Wreturn-type]
906 | }
| ^Fix obvious typo.
---
v2: added tag (Simon)
common/image-board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/image-board.c +1 -1
@@ -898,7 +898,7 @@ int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd)debug ("## kernel board info at 0x%08lx\n" , (ulong)*kbd);#if defined(DEBUG ) - if (IS_ENABLED(CONFIG_CMD_BDI) +if (IS_ENABLED (CONFIG_CMD_BDI ))do_bdinfo (NULL ,0 ,0 ,NULL );#endif
Signature · 1 line
2.33.0
PATCH v2 2/2 image: Explicitly declare do_bdinfo()
Compiler is not happy:
common/image-board.c: In function ‘boot_get_kbd’:common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration]
902 | do_bdinfo(NULL, 0, 0, NULL);
| ^~~~~~~~~Move the forward declaration to a header.
---
v2: dropped ifdeffery and extern (Simon), included header to the users
common/image-board.c | 1 + common/image.c | 6 +----- include/init.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-)
common/image-board.c +1 -0
@@ -14,6 +14,7 @@#include <env.h> #include <fpga.h> #include <image.h> +#include <init.h> #include <mapmem.h> #include <rtc.h> #include <watchdog.h>
common/image.c +1 -5
@@ -9,6 +9,7 @@#ifndef USE_HOSTCC #include <common.h> #include <env.h> +#include <init.h> #include <lmb.h> #include <log.h> #include <malloc.h>
@@ -29,11 +30,6 @@#include <linux/errno.h> #include <asm/io.h> -#ifdef CONFIG_CMD_BDI -extern int do_bdinfo (struct cmd_tbl *cmdtp,int flag,int argc, -char *const argv[]); -#endif -DECLARE_GLOBAL_DATA_PTR ;/* Set this if we have less than 4 MB of malloc() space */
include/init.h +2 -0
@@ -332,6 +332,8 @@ void bdinfo_print_mhz(const char *name, unsigned long hz);/* Show arch-specific information for the 'bd' command */ void arch_print_bdinfo (void ); +int do_bdinfo (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +#endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */
Signature · 1 line
2.33.0
Re: [PATCH v2 2/2] image: Explicitly declare do_bdinfo()
Quoted 10 lines · Andy Shevchenko
Compiler is not happy:
common/image-board.c: In function ‘boot_get_kbd’:common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration]902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~Move the forward declaration to a header.
Quoted 8 lines
Signed-off-by Andy Shevchenko <[email protected]>---
v2: dropped ifdeffery and extern (Simon), included header to the userscommon/image-board.c | 1 + common/image.c | 6 +----- include/init.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-)
Re: [PATCH v2 2/2] image: Explicitly declare do_bdinfo()
In reply to Andy ShevchenkoQuoted 11 lines · Andy Shevchenko
Compiler is not happy:
common/image-board.c: In function ‘boot_get_kbd’:common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration]902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~Move the forward declaration to a header.
Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Quoted 44 lines · Andy Shevchenko
After the commit
4ed37abc49c2("image: Remove ifdefs aroundimage_setup_linux()el at"):
common/image-board.c: In function ‘boot_get_kbd’:common/image-board.c:902:17: error: expected ‘)’ before ‘do_bdinfo’902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~
common/image-board.c:901:12: note: to match this ‘(’
901 | if (IS_ENABLED(CONFIG_CMD_BDI)
| ^common/image-board.c:906:1: error: expected expression before ‘}’ token
906 | }| ^ common/image-board.c:906:1: warning: control reaches end of non-void function [-Wreturn-type] 906 | } | ^Fix obvious typo.
Fixes 4ed37abc49c2 ("image: Remove ifdefs around image_setup_linux() el at")Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Simon Glass <[email protected]>---
v2: added tag (Simon)common/image-board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/image-board.c +1
-2@@ -898,7 +898,7 @@ int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd)debug ("## kernel board info at 0x%08lx\n" , (ulong)*kbd);#if defined(DEBUG ) - if (IS_ENABLED(CONFIG_CMD_BDI) +if (IS_ENABLED (CONFIG_CMD_BDI ))do_bdinfo (NULL ,0 ,0 ,NULL );#endif --2.33.0