All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/7] dfu: Remove dependency on HUSH parser in SPL
Date: Fri, 30 Nov 2018 11:11:19 -0600	[thread overview]
Message-ID: <20181130171123.23009-4-afd@ti.com> (raw)
In-Reply-To: <20181130171123.23009-1-afd@ti.com>

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>
---
 common/Makefile | 1 -
 common/cli.c    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 69cec69608..bbb03e1c57 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 51b8d5f85c..fea8f8004c 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.
-- 
2.19.1

  parent reply	other threads:[~2018-11-30 17:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 17:11 [U-Boot] [PATCH 0/7] Add USB/UART boot to HS DRA7xx/AM57xx Andrew F. Davis
2018-11-30 17:11 ` [U-Boot] [PATCH 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
2018-11-30 17:11 ` [U-Boot] [PATCH 2/7] dfu: Make DFU support more SPL friendly Andrew F. Davis
2018-11-30 17:11 ` Andrew F. Davis [this message]
2018-11-30 17:11 ` [U-Boot] [PATCH 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point Andrew F. Davis
2018-11-30 17:11 ` [U-Boot] [PATCH 5/7] defconfigs: Add config for DRA7xx High Security EVM with UART/USB Boot support Andrew F. Davis
2018-12-03  5:22   ` Lokesh Vutla
2018-11-30 17:11 ` [U-Boot] [PATCH 6/7] defconfigs: Add config for AM57xx " Andrew F. Davis
2018-12-03  5:24   ` Lokesh Vutla
2018-12-04 21:37     ` Andrew F. Davis
2018-12-05 12:42       ` Lokesh Vutla
2018-12-05 17:24         ` Andrew F. Davis
2018-11-30 17:11 ` [U-Boot] [PATCH 7/7] doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI Andrew F. Davis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181130171123.23009-4-afd@ti.com \
    --to=afd@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.