[PATCH 18/19] bootm: Skip command-line substitution if !CONFIG_CMDLINE

Simon Glass sjg at chromium.org
Mon Mar 15 06:11:23 CET 2021


When there is no command line, we cannot enable this feature. Add a check
to avoid a build error.

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

 common/bootm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/bootm.c b/common/bootm.c
index dab7c3619fd..ea71522d0c9 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -583,7 +583,8 @@ int bootm_process_cmdline(char *buf, int maxlen, int flags)
 		if (ret)
 			return log_msg_ret("silent", ret);
 	}
-	if (IS_ENABLED(CONFIG_BOOTARGS_SUBST) && (flags & BOOTM_CL_SUBST)) {
+	if (IS_ENABLED(CONFIG_BOOTARGS_SUBST) && IS_ENABLED(CONFIG_CMDLINE) &&
+	    (flags & BOOTM_CL_SUBST)) {
 		ret = process_subst(buf, maxlen);
 		if (ret)
 			return log_msg_ret("subst", ret);
-- 
2.31.0.rc2.261.g7f71774620-goog



More information about the U-Boot mailing list