From 81b1158897dde57a4b26fea5ef927cf512e64b87 Mon Sep 17 00:00:00 2001 From: Andrej Rosano Date: Mon, 29 Jul 2019 09:24:53 +0200 Subject: Drop linker-generated array creation when CONFIG_CMDLINE is disabled Linker generated array entry is not needed when the command line is disabled. Remove this code in that case. This is required as the commit 80a48dd47e3bf3ede676fae5a630cb6c80de3e69 breaks the linking stage when CONFIG_CMDLINE=n: .. LDS u-boot.lds LD u-boot u-boot contains unexpected relocations: R_ARM_NONE R_ARM_RELATIVE make: *** [Makefile:1775: checkarmreloc] Error 1 Signed-off-by: Andrej Rosano --- cmd/help.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd') diff --git a/cmd/help.c b/cmd/help.c index fa2010c67eb..a1a0b99b6ff 100644 --- a/cmd/help.c +++ b/cmd/help.c @@ -27,6 +27,7 @@ U_BOOT_CMD( " - print detailed usage of 'command'" ); +#ifdef CONFIG_CMDLINE /* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */ ll_entry_declare(cmd_tbl_t, question_mark, cmd) = { "?", CONFIG_SYS_MAXARGS, cmd_always_repeatable, do_help, @@ -35,3 +36,4 @@ ll_entry_declare(cmd_tbl_t, question_mark, cmd) = { "" #endif /* CONFIG_SYS_LONGHELP */ }; +#endif -- cgit v1.2.3 From f043dc28e3cce115089fb9ab86bc6f4bc4a8a882 Mon Sep 17 00:00:00 2001 From: Eric Perie Date: Sat, 13 Jul 2019 14:54:58 -0400 Subject: Add validation for icache/dcache arguments - arguments different from off/on/flush are currently silently ignored. Signed-off-by: Eric Perie --- cmd/cache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/cache.c b/cmd/cache.c index 233f428054e..2c687173a8b 100644 --- a/cmd/cache.c +++ b/cmd/cache.c @@ -22,7 +22,7 @@ void __weak invalidate_icache_all(void) static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { - case 2: /* on / off */ + case 2: /* on / off / flush */ switch (parse_argv(argv[1])) { case 0: icache_disable(); @@ -33,6 +33,8 @@ static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) case 2: invalidate_icache_all(); break; + default: + return CMD_RET_USAGE; } break; case 1: /* get status */ @@ -54,7 +56,7 @@ void __weak flush_dcache_all(void) static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { - case 2: /* on / off */ + case 2: /* on / off / flush */ switch (parse_argv(argv[1])) { case 0: dcache_disable(); @@ -65,6 +67,8 @@ static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) case 2: flush_dcache_all(); break; + default: + return CMD_RET_USAGE; } break; case 1: /* get status */ -- cgit v1.2.3