diff mbox series

[02/18] bootm: plan: Drop passing of arguments

Message ID 20231204002642.895926-3-sjg@chromium.org
State Superseded
Delegated to: Tom Rini
Headers show
Series Complete decoupling of bootm logic from commands | expand

Commit Message

Simon Glass Dec. 4, 2023, 12:26 a.m. UTC
It isn't clear how useful it is to pass the arguments of bootm to the
OS. For example, if "bootm 1000 2000 3000" is used, the three arguments
at the end are passed to the OS. This seems like a strange approach,
since the argument have already been parsed by U-Boot and processed.

Rely instead on the "bootargs" mechanism, which is the standard
approach.

Drop the helper function as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 boot/bootm_os.c | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)
diff mbox series

Patch

diff --git a/boot/bootm_os.c b/boot/bootm_os.c
index b5055d78706c..4aa1db848d6c 100644
--- a/boot/bootm_os.c
+++ b/boot/bootm_os.c
@@ -41,20 +41,6 @@  static int do_bootm_standalone(int flag, int argc, char *const argv[],
 /* OS booting routines */
 /*******************************************************************/
 
-#if defined(CONFIG_BOOTM_NETBSD) || defined(CONFIG_BOOTM_PLAN9)
-static void copy_args(char *dest, int argc, char *const argv[], char delim)
-{
-	int i;
-
-	for (i = 0; i < argc; i++) {
-		if (i > 0)
-			*dest++ = delim;
-		strcpy(dest, argv[i]);
-		dest += strlen(argv[i]);
-	}
-}
-#endif
-
 static void __maybe_unused fit_unsupported_reset(const char *msg)
 {
 	if (CONFIG_IS_ENABLED(FIT_VERBOSE)) {
@@ -211,16 +197,12 @@  static int do_bootm_plan9(int flag, int argc, char *const argv[],
 
 	/* See README.plan9 */
 	s = env_get("confaddr");
-	if (s != NULL) {
+	if (s) {
 		char *confaddr = (char *)hextoul(s, NULL);
 
-		if (argc > 0) {
-			copy_args(confaddr, argc, argv, '\n');
-		} else {
-			s = env_get("bootargs");
-			if (s != NULL)
-				strcpy(confaddr, s);
-		}
+		s = env_get("bootargs");
+		if (!s)
+			strcpy(confaddr, s);
 	}
 
 	entry_point = (void (*)(void))images->ep;