aboutsummaryrefslogtreecommitdiff
path: root/common/bootm.c
diff options
context:
space:
mode:
authorSimon Glass2020-11-05 10:33:38 -0700
committerTom Rini2020-12-04 16:09:26 -0500
commitf158ba15ee0f9f756193b60420adfdc0a9c1eb96 (patch)
tree7fa87c022e1258306c4c5947e661bcf039bfe7e7 /common/bootm.c
parent96434a76fd254248ded19e95dc967d28e65a5edf (diff)
bootm: Add tests for fixup_silent_linux()
This function currently has no tests. Export it so that we can implement a simple test on sandbox. Use IS_ENABLED() to remove the unused code, instead #ifdef. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/bootm.c')
-rw-r--r--common/bootm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/bootm.c b/common/bootm.c
index 167eea4a1e9..0d36c572101 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -465,18 +465,21 @@ ulong bootm_disable_interrupts(void)
return iflag;
}
-#if defined(CONFIG_SILENT_CONSOLE) && !defined(CONFIG_SILENT_U_BOOT_ONLY)
-
#define CONSOLE_ARG "console="
#define CONSOLE_ARG_LEN (sizeof(CONSOLE_ARG) - 1)
-static void fixup_silent_linux(void)
+void fixup_silent_linux(void)
{
char *buf;
const char *env_val;
- char *cmdline = env_get("bootargs");
+ char *cmdline;
int want_silent;
+ if (!IS_ENABLED(CONFIG_SILENT_CONSOLE) &&
+ !IS_ENABLED(CONFIG_SILENT_U_BOOT_ONLY))
+ return;
+ cmdline = env_get("bootargs");
+
/*
* Only fix cmdline when requested. The environment variable can be:
*
@@ -523,7 +526,6 @@ static void fixup_silent_linux(void)
debug("after silent fix-up: %s\n", env_val);
free(buf);
}
-#endif /* CONFIG_SILENT_CONSOLE */
/**
* Execute selected states of the bootm command.
@@ -627,10 +629,8 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc,
if (!ret && (states & BOOTM_STATE_OS_BD_T))
ret = boot_fn(BOOTM_STATE_OS_BD_T, argc, argv, images);
if (!ret && (states & BOOTM_STATE_OS_PREP)) {
-#if defined(CONFIG_SILENT_CONSOLE) && !defined(CONFIG_SILENT_U_BOOT_ONLY)
if (images->os.os == IH_OS_LINUX)
fixup_silent_linux();
-#endif
ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images);
}