Re: [PATCH v1 1/1] intel_idle: Use 2-argument strscpy()

From: Rafael J. Wysocki (Intel)

Date: Fri Sep 04 2026 - 11:16:31 EST


On Thu, Aug 13, 2026 at 10:26 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
>
> 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@xxxxxxxxxxxxxxx>
> ---
> 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
> --

Applied as 7.4 material, thanks!