From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEAD74BEE43; Sat, 12 Sep 2026 18:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789238894; cv=none; b=Xeyc417C4XOUFhr1OUUaac/xETiWpKrqfxrXvhPXX/cI3y1+jz8B7qSaumN6vUWyVbsDc+j1zP2/I7pPft8axCVrUrw7k5t4caIVyc/fwB0kItObySjum8Qaf2qOoFzUAHMRN2Z1+VCPhlw/EDirIxOcVrzhzKA33iz+a0mD/xQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789238894; c=relaxed/simple; bh=xmaMBS7yWfRp5Ltv1Szi6uAogICnmU6gvZV5VYlSG8I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J4QcZpiWXxJUeR1z7erMhHIWb+PmwlA+Kk2PWvUXmCI8GgZu2Xn4KV6e12uzcM7HKpvfqpUmPFTzO5MjZge86tnWe498WzImiXE/RVe3c3pvPGYwgdbHJuD3ij1ww61t7gH1OJiiuSrraVzjfyMFHACCzMr4SPNZGJNKkF6//AA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i3UfwSYI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="i3UfwSYI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3A581F000FF; Sat, 12 Sep 2026 18:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789238892; bh=99RUZxQ9K8AuZoxf2nffDKYgjo5wZ0XSDeHaiAY1jf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=i3UfwSYI4AWzpRkm20jG1fyBE/73+0AemZlLysXu+uAofqi6bDDpW+rC2wbQCwVqq GCnnATdZ8hXG7LB3VKCn0O1igNWnZwQOnx3NRV2XsQl+wCY3heSzCAH3Jn9jf1dr5e QKm7wAZcX+yOtCFekLh5DoWT6/Prfy4xUrIuboBs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wolfram Sang , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.15 537/935] ACPI: move from strlcpy() with unused retval to strscpy() Date: Sat, 12 Sep 2026 08:59:27 +0200 Message-ID: <20260912065539.139139348@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wolfram Sang [ Upstream commit b75d2cd06b33956b7ec35c6316e717c25a196ee5 ] Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki Stable-dep-of: d5c13047a132 ("ACPI: processor: idle: Expand _LPI package sanity checks") Signed-off-by: Sasha Levin --- drivers/acpi/bus.c | 4 ++-- drivers/acpi/processor_idle.c | 8 ++++---- drivers/acpi/utils.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index ea63b8f272892..d22e54cbd2a6f 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -781,7 +781,7 @@ static bool acpi_of_modalias(struct acpi_device *adev, str = obj->string.pointer; chr = strchr(str, ','); - strlcpy(modalias, chr ? chr + 1 : str, len); + strscpy(modalias, chr ? chr + 1 : str, len); return true; } @@ -801,7 +801,7 @@ void acpi_set_modalias(struct acpi_device *adev, const char *default_id, char *modalias, size_t len) { if (!acpi_of_modalias(adev, modalias, len)) - strlcpy(modalias, default_id, len); + strscpy(modalias, default_id, len); } EXPORT_SYMBOL_GPL(acpi_set_modalias); diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6b71082d474f9..bbdca25542666 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -796,7 +796,7 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) state = &drv->states[count]; snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); - strlcpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); + strscpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); state->exit_latency = cx->latency; state->target_residency = cx->latency * latency_factor; state->enter = acpi_idle_enter; @@ -965,7 +965,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle, obj = pkg_elem + 9; if (obj->type == ACPI_TYPE_STRING) - strlcpy(lpi_state->desc, obj->string.pointer, + strscpy(lpi_state->desc, obj->string.pointer, ACPI_CX_DESC_LEN); lpi_state->index = state_idx; @@ -1031,7 +1031,7 @@ static bool combine_lpi_states(struct acpi_lpi_state *local, result->arch_flags = parent->arch_flags; result->index = parent->index; - strlcpy(result->desc, local->desc, ACPI_CX_DESC_LEN); + strscpy(result->desc, local->desc, ACPI_CX_DESC_LEN); strlcat(result->desc, "+", ACPI_CX_DESC_LEN); strlcat(result->desc, parent->desc, ACPI_CX_DESC_LEN); return true; @@ -1207,7 +1207,7 @@ static int acpi_processor_setup_lpi_states(struct acpi_processor *pr) state = &drv->states[i]; snprintf(state->name, CPUIDLE_NAME_LEN, "LPI-%d", i); - strlcpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN); + strscpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN); state->exit_latency = lpi->wake_latency; state->target_residency = lpi->min_residency; if (lpi->arch_flags) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index d5cedffeeff91..bf1b972bda2c5 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -840,7 +840,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) struct acpi_dev_match_info match = {}; struct device *dev; - strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); + strscpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.hrv = hrv; @@ -873,7 +873,7 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha struct acpi_dev_match_info match = {}; struct device *dev; - strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); + strscpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); match.uid = uid; match.hrv = hrv; @@ -923,7 +923,7 @@ EXPORT_SYMBOL(acpi_video_backlight_string); static int __init acpi_backlight(char *str) { - strlcpy(acpi_video_backlight_string, str, + strscpy(acpi_video_backlight_string, str, sizeof(acpi_video_backlight_string)); return 1; } -- 2.53.0