* [PATCH v1 1/1] intel_idle: Use 2-argument strscpy()
@ 2026-08-13 8:26 Andy Shevchenko
0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2026-08-13 8:26 UTC (permalink / raw)
To: Rafael J. Wysocki, linux-pm, linux-kernel
Cc: Rafael J. Wysocki, Artem Bityutskiy, Len Brown, Andy Shevchenko,
Andy Shevchenko
From: Andy Shevchenko <andy.shevchenko@gmail.com>
Use 2-argument strscpy(), which is not only shorter but also provides
an additional check that destination buffer is an array.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/idle/intel_idle.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 699665f24ecd..01a68f5b9020 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1904,7 +1904,7 @@ static void __init intel_idle_init_cstates_acpi_lpi(struct cpuidle_driver *drv)
state = &drv->states[drv->state_count++];
scnprintf(state->name, CPUIDLE_NAME_LEN, "C%d_LPI", index + 1);
- strscpy(state->desc, lpi_state->desc, CPUIDLE_DESC_LEN);
+ strscpy(state->desc, lpi_state->desc);
state->exit_latency = lpi_state->wake_latency;
state->target_residency = lpi_state->min_residency;
state->flags = MWAIT2flg(lpi_state->address);
@@ -1954,7 +1954,7 @@ static void __init intel_idle_init_cstates_acpi_cst(struct cpuidle_driver *drv)
state = &drv->states[drv->state_count++];
snprintf(state->name, CPUIDLE_NAME_LEN, "C%d_ACPI", cstate);
- strscpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
+ strscpy(state->desc, cx->desc);
state->exit_latency = cx->latency;
/*
* For C1-type C-states use the same number for both the exit
--
2.50.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-13 8:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 8:26 [PATCH v1 1/1] intel_idle: Use 2-argument strscpy() Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox