[Concept,01/13] console: Add a Kconfig option for putsn() support

Message ID 20260204001002.2638622-2-sjg@u-boot.org
State New
Headers
Series Add putsn() for length-based console output |

Commit Message

Simon Glass Feb. 4, 2026, 12:09 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add CONFIG_CONSOLE_PUTSN option to enable the putsn() function for
length-based string output. This allows printing strings without
requiring nul-termination.

Co-developed-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 common/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/common/Kconfig b/common/Kconfig
index c709df753bf..fd1f9cc5bcb 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -54,6 +54,15 @@  config CONSOLE_RECORD_IN_SIZE
 	  The buffer is allocated immediately after the malloc() region is
 	  ready.
 
+config CONSOLE_PUTSN
+	bool "Enable putsn() function for length-based output"
+	default y if SANDBOX
+	help
+	  Enable the putsn() function which outputs a string with a
+	  specified length without requiring nul-termination. This is
+	  useful for printing substrings or binary data without
+	  allocating temporary buffers.
+
 config SYS_CBSIZE
 	int "Console input buffer size"
 	default 2048 if ARCH_TEGRA || ARCH_VERSAL || ARCH_ZYNQ || ARCH_ZYNQMP || \