Skip to content

Commit 2e44856

Browse files
tobluxPaul Walmsley
authored andcommitted
cpuidle: riscv-sbi: Replace deprecated strcpy in sbi_cpuidle_init_cpu
strcpy() is deprecated; use strscpy() instead. Link: KSPP#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>
1 parent 5228ed2 commit 2e44856

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/cpuidle/cpuidle-riscv-sbi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/module.h>
1919
#include <linux/of.h>
2020
#include <linux/slab.h>
21+
#include <linux/string.h>
2122
#include <linux/platform_device.h>
2223
#include <linux/pm_domain.h>
2324
#include <linux/pm_runtime.h>
@@ -303,8 +304,8 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
303304
drv->states[0].exit_latency = 1;
304305
drv->states[0].target_residency = 1;
305306
drv->states[0].power_usage = UINT_MAX;
306-
strcpy(drv->states[0].name, "WFI");
307-
strcpy(drv->states[0].desc, "RISC-V WFI");
307+
strscpy(drv->states[0].name, "WFI");
308+
strscpy(drv->states[0].desc, "RISC-V WFI");
308309

309310
/*
310311
* If no DT idle states are detected (ret == 0) let the driver

0 commit comments

Comments
 (0)