[PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks

Jonas Karlman jonas at kwiboo.se
Thu Jul 9 00:05:36 CEST 2026


The xPL_SILENT_CONSOLE Kconfig symbols are not fully respected for xPL
builds, instead common code is guarded by a mix of SILENT_CONSOLE and
xPL_SILENT_CONSOLE symbols.

Change to consistently use CONFIG_IS_ENABLED(SILENT_CONSOLE) to make the
common code properly guarded by the intended Kconfig symbol.

Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
---
 board/friendlyarm/nanopi2/board.c |  4 ++--
 boot/bootm.c                      |  4 ++--
 common/autoboot.c                 |  2 +-
 common/console.c                  | 12 ++++++------
 include/env_callback.h            |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
index 5e560a7f9275..be092f3d5a27 100644
--- a/board/friendlyarm/nanopi2/board.c
+++ b/board/friendlyarm/nanopi2/board.c
@@ -441,7 +441,7 @@ int board_init(void)
 	bd_lcd_config_gpio();
 	bd_lcd_init();
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE))
 		gd->flags |= GD_FLG_SILENT;
 
 	return 0;
@@ -459,7 +459,7 @@ int board_late_init(void)
 
 	set_ether_addr();
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE))
 		gd->flags &= ~GD_FLG_SILENT;
 
 	bd_backlight_on();
diff --git a/boot/bootm.c b/boot/bootm.c
index 803d6406be40..3cbd824f0df5 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -873,7 +873,7 @@ int bootm_process_cmdline(char *buf, int maxlen, int flags)
 	int ret;
 
 	/* Check config first to enable compiler to eliminate code */
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) &&
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) &&
 	    !IS_ENABLED(CONFIG_SILENT_U_BOOT_ONLY) &&
 	    (flags & BOOTM_CL_SILENT)) {
 		ret = fixup_silent_linux(buf, maxlen);
@@ -899,7 +899,7 @@ int bootm_process_cmdline_env(int flags)
 	int ret;
 
 	/* First check if any action is needed */
-	do_silent = IS_ENABLED(CONFIG_SILENT_CONSOLE) &&
+	do_silent = CONFIG_IS_ENABLED(SILENT_CONSOLE) &&
 	    !IS_ENABLED(CONFIG_SILENT_U_BOOT_ONLY) && (flags & BOOTM_CL_SILENT);
 	if (!do_silent && !IS_ENABLED(CONFIG_BOOTARGS_SUBST))
 		return 0;
diff --git a/common/autoboot.c b/common/autoboot.c
index 4b80ddb5b28f..a3d932f290f4 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -426,7 +426,7 @@ static int abortboot(int bootdelay)
 			abort = abortboot_single_key(bootdelay);
 	}
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && abort)
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && abort)
 		gd->flags &= ~GD_FLG_SILENT;
 
 	return abort;
diff --git a/common/console.c b/common/console.c
index 54d1249422d4..eb84d1732939 100644
--- a/common/console.c
+++ b/common/console.c
@@ -72,7 +72,7 @@ static int on_console(const char *name, const char *value, enum env_op op,
 }
 U_BOOT_ENV_CALLBACK(console, on_console);
 
-#ifdef CONFIG_SILENT_CONSOLE
+#if CONFIG_IS_ENABLED(SILENT_CONSOLE)
 static int on_silent(const char *name, const char *value, enum env_op op,
 	int flags)
 {
@@ -687,7 +687,7 @@ static void print_pre_console_buffer(int flushpoint)
 	char buf_out[CONFIG_VAL(PRE_CON_BUF_SZ) + 1];
 	char *buf_in;
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
 		return;
 
 	buf_in = map_sysmem(CONFIG_VAL(PRE_CON_BUF_ADDR), CONFIG_VAL(PRE_CON_BUF_SZ));
@@ -736,7 +736,7 @@ void putc(const char c)
 		return;
 	}
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
 		if (!(gd->flags & GD_FLG_DEVINIT))
 			pre_console_putc(c);
 		return;
@@ -776,7 +776,7 @@ void puts(const char *s)
 		return;
 	}
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
 		if (!(gd->flags & GD_FLG_DEVINIT))
 			pre_console_puts(s);
 		return;
@@ -813,7 +813,7 @@ void flush(void)
 	if (IS_ENABLED(CONFIG_DEBUG_UART) && !(gd->flags & GD_FLG_SERIAL_READY))
 		return;
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
 		return;
 
 	if (IS_ENABLED(CONFIG_DISABLE_CONSOLE) && (gd->flags & GD_FLG_DISABLE_CONSOLE))
@@ -999,7 +999,7 @@ static bool console_update_silent(void)
 {
 	unsigned long flags = gd->flags;
 
-	if (!IS_ENABLED(CONFIG_SILENT_CONSOLE))
+	if (!CONFIG_IS_ENABLED(SILENT_CONSOLE))
 		return false;
 
 	if (IS_ENABLED(CONFIG_SILENT_CONSOLE_UNTIL_ENV) && !(gd->flags & GD_FLG_ENV_READY)) {
diff --git a/include/env_callback.h b/include/env_callback.h
index 1181ab4a1579..131bf76206e5 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -14,7 +14,7 @@
 
 #define ENV_CALLBACK_VAR ".callbacks"
 
-#ifdef CONFIG_SILENT_CONSOLE
+#if CONFIG_IS_ENABLED(SILENT_CONSOLE)
 #define SILENT_CALLBACK "silent:silent,"
 #else
 #define SILENT_CALLBACK
-- 
2.54.0



More information about the U-Boot mailing list