From 84477867e122251b8c47db240a8d699b0836aa6f Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Thu, 30 Apr 2026 11:02:54 +0200 Subject: tty: xtensa/iss: use strnlen to improve iss_console_write Use strnlen() to limit scanning 's' to 'count' bytes. Use the length of 's' to decide if simc_write() should be called instead of dereferencing it first and then calling strlen(). With strnlen(), iss_console_write() is further hardened against callers where 's' is not NUL-terminated. Signed-off-by: Thorsten Blum Message-ID: <20260430090253.237654-3-thorsten.blum@linux.dev> Signed-off-by: Max Filippov --- arch/xtensa/platforms/iss/console.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 8b95221375a8..8e54625cb2ba 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -166,8 +166,9 @@ late_initcall(rs_init); static void iss_console_write(struct console *co, const char *s, unsigned count) { - if (s && *s != 0) - simc_write(1, s, min(count, strlen(s))); + count = s ? strnlen(s, count) : 0; + if (count) + simc_write(1, s, count); } static struct tty_driver* iss_console_device(struct console *c, int *index) -- cgit v1.2.3 From a7c958e8721eb2724ee2e2ef13129bc67e1c8a75 Mon Sep 17 00:00:00 2001 From: Ethan Nelson-Moore Date: Mon, 15 Jun 2026 15:49:54 -0700 Subject: xtensa: correct CONFIG_XTENSA_CALIBRATE_CCOUNT macro name in comment A comment in arch/xtensa/include/asm/platform.h incorrectly refers to CONFIG_XTENSA_CALIBRATE instead of CONFIG_XTENSA_CALIBRATE_CCOUNT. Correct it. Discovered while searching for CONFIG_* symbols referenced in code but not defined in any Kconfig file. Signed-off-by: Ethan Nelson-Moore Message-ID: <20260615224957.21574-1-enelsonmoore@gmail.com> Signed-off-by: Max Filippov --- arch/xtensa/include/asm/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/include/asm/platform.h b/arch/xtensa/include/asm/platform.h index 94f13fabf7cd..f2e50fc12b4d 100644 --- a/arch/xtensa/include/asm/platform.h +++ b/arch/xtensa/include/asm/platform.h @@ -33,7 +33,7 @@ extern void platform_setup (char **); extern void platform_idle (void); /* - * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE) + * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE_CCOUNT) */ extern void platform_calibrate_ccount (void); -- cgit v1.2.3 From eb049bdbf2b98d103d93daef44a5e1a0164d01eb Mon Sep 17 00:00:00 2001 From: Anthony Iliopoulos Date: Thu, 20 Aug 2026 14:36:51 +0200 Subject: xtensa: remove unused setup_profiling_timer function setup_profiling_timer() is not used by any code at this point. Since a default weak implementation exists, there is no need to keep this arch-specific definition around. Remove it along with the now-redundant profile header includes. Signed-off-by: Anthony Iliopoulos Message-ID: <20260820123711.142005-1-ailiop@suse.com> Signed-off-by: Max Filippov --- arch/xtensa/kernel/smp.c | 7 ------- arch/xtensa/kernel/time.c | 1 - 2 files changed, 8 deletions(-) diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c index 94a23f100726..e4c25d0c2158 100644 --- a/arch/xtensa/kernel/smp.c +++ b/arch/xtensa/kernel/smp.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -459,12 +458,6 @@ void show_ipi_list(struct seq_file *p, int prec) } } -int setup_profiling_timer(unsigned int multiplier) -{ - pr_debug("setup_profiling_timer %d\n", multiplier); - return 0; -} - /* TLB flush functions */ struct flush_data { diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 1c3dfea843ec..09fda6a3fe3b 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3