aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAndrew F. Davis2019-01-17 13:43:04 -0600
committerTom Rini2019-01-26 08:13:55 -0500
commit2dd468dbe13ceafad23e000d250990c7087206d2 (patch)
treea8071586f6a89b3b27b97f8a2aa4a49130b86adc /common
parent2d59ec84829ff339041667c857afe94d5160f4b4 (diff)
dfu: Remove dependency on HUSH parser in SPL
CLI support with the HUSH parser is not currently SPL safe due to it's use of realloc. That function is not defined for SPLs that use SYS_MALLOC_SIMPLE. CLI support can be built in to SPL and some functions do work, but use of some like run_command() will cause build to fail. When no SPL code calls this function build works as the compiler removes this unreachable code so the unresolved symbols are ignored. If DFU support is enabled in SPL then MMU DFU support may get brought in also, this code does make a call to run_command() causing build to fail if the HUSH parser is not built-in. To break this odd and unneeded dependency chain we use CONFIG_IS_ENABLED where appropriate to prevent calls into HUSH code from SPL. This also removes our need to pull in the rather unrelated source file when SPL_DFU is defined. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
-rw-r--r--common/Makefile1
-rw-r--r--common/cli.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/common/Makefile b/common/Makefile
index 37110165055..ad390d083ac 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -67,7 +67,6 @@ ifdef CONFIG_SPL_BUILD
ifdef CONFIG_SPL_DFU
obj-$(CONFIG_DFU_OVER_USB) += dfu.o
endif
-obj-$(CONFIG_SPL_DFU) += cli_hush.o
obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
obj-$(CONFIG_TPL_HASH_SUPPORT) += hash.o
obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
diff --git a/common/cli.c b/common/cli.c
index 51b8d5f85cb..fea8f8004c3 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/
int run_command(const char *cmd, int flag)
{
-#ifndef CONFIG_HUSH_PARSER
+#if !CONFIG_IS_ENABLED(HUSH_PARSER)
/*
* cli_run_command can return 0 or 1 for success, so clean up
* its result.