All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] Make the sandbox board_run_command the default
Date: Tue, 17 Dec 2019 21:17:23 -0500	[thread overview]
Message-ID: <bb64fc0c-2f21-fbb1-f8d9-8acd8a056c97@gmail.com> (raw)

If CONFIG_CMDLINE=n, common/cli.c calls board_run_command. This fails to
link on most architectures. However, the sandbox architecture has an
implementation which we can use.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
 arch/sandbox/cpu/start.c | 7 -------
 common/cli.c             | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index fff9cbdd79..5b7d54869d 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -319,13 +319,6 @@ static int sandbox_cmdline_cb_show_of_platdata(struct
sandbox_state *state,
 }
 SANDBOX_CMDLINE_OPT(show_of_platdata, 0, "Show of-platdata in SPL");

-int board_run_command(const char *cmdline)
-{
-	printf("## Commands are disabled. Please enable CONFIG_CMDLINE.\n");
-
-	return 1;
-}
-
 static void setup_ram_buf(struct sandbox_state *state)
 {
 	/* Zero the RAM buffer if we didn't read it, to keep valgrind happy */
diff --git a/common/cli.c b/common/cli.c
index 67ceb635a6..59551ef40b 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -70,6 +70,13 @@ int run_command_repeatable(const char *cmd, int flag)
 	return 0;
 #endif
 }
+#else
+__weak int board_run_command(const char *cmdline)
+{
+	printf("## Commands are disabled. Please enable CONFIG_CMDLINE.\n");
+
+	return 1;
+}
 #endif /* CONFIG_CMDLINE */

 int run_command_list(const char *cmd, int len, int flag)
-- 
2.23.0

             reply	other threads:[~2019-12-18  2:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  2:17 Sean Anderson [this message]
2020-01-10  9:04 ` [PATCH] Make the sandbox board_run_command the default Simon Glass
2020-01-10 17:30   ` Sean Anderson
2020-01-10 17:32   ` [PATCH v2] cli: " Sean Anderson
2020-02-04 10:40     ` Bin Meng
2020-02-05 17:57     ` sjg at google.com

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=bb64fc0c-2f21-fbb1-f8d9-8acd8a056c97@gmail.com \
    --to=seanga2@gmail.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.