]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpuidle: riscv-sbi: Replace deprecated strcpy in sbi_cpuidle_init_cpu
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 21 Oct 2025 13:51:54 +0000 (15:51 +0200)
committerPaul Walmsley <pjw@kernel.org>
Tue, 28 Oct 2025 05:38:13 +0000 (23:38 -0600)
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20251021135155.1409-2-thorsten.blum@linux.dev
Signed-off-by: Paul Walmsley <pjw@kernel.org>
drivers/cpuidle/cpuidle-riscv-sbi.c

index a360bc4d20b7645f8f93a2d03e2bba0186fa1875..19be6475d3565342feb8bb354e38b3a661d3ec93 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
@@ -303,8 +304,8 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
        drv->states[0].exit_latency = 1;
        drv->states[0].target_residency = 1;
        drv->states[0].power_usage = UINT_MAX;
-       strcpy(drv->states[0].name, "WFI");
-       strcpy(drv->states[0].desc, "RISC-V WFI");
+       strscpy(drv->states[0].name, "WFI");
+       strscpy(drv->states[0].desc, "RISC-V WFI");
 
        /*
         * If no DT idle states are detected (ret == 0) let the driver