[PATCH 3/4] ARM: OMAP2: clean up string copying and formatting in omap3_cpuinfo
Thorsten Blum
thorsten.blum at linux.dev
Thu Apr 23 10:10:19 PDT 2026
Replace scnprintf("%s") with the faster and more direct strscpy().
Remove unnecessary and inconsistent 'n' arithmetic when 'n = 0', and
when 'n' is no longer used at the end of the function.
Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>
---
arch/arm/mach-omap2/id.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 25ded74e4b01..126ffd87f572 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -255,7 +255,7 @@ static void __init omap3_cpuinfo(void)
strscpy(soc_name, cpu_name);
/* Print verbose information */
- n += scnprintf(buf, sizeof(buf) - n, "%s %s (", soc_name, soc_rev);
+ n += scnprintf(buf, sizeof(buf), "%s %s (", soc_name, soc_rev);
OMAP3_SHOW_FEATURE(l2cache);
OMAP3_SHOW_FEATURE(iva);
@@ -265,7 +265,7 @@ static void __init omap3_cpuinfo(void)
OMAP3_SHOW_FEATURE(192mhz_clk);
if (*(buf + n - 1) == ' ')
n--;
- n += scnprintf(buf + n, sizeof(buf) - n, ")\n");
+ scnprintf(buf + n, sizeof(buf) - n, ")\n");
pr_info("%s", buf);
}
More information about the linux-arm-kernel
mailing list