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 DFE4D4A35; Sat, 12 Sep 2026 19:49:43 +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=1789242585; cv=none; b=r7BEuR1bl45wPGeYwPg2DMxqO/swUdOE50FptLPLGtN9y/3LKkcM3O11qZtJ78N7cqUQAN3qlE8SQu6ApGpsazSIP8BuC/fuEzXexe4EhoUS+G0xQ7WS9ySHZjEEgJzal9G5vlYnnT0jLObWIqATz0Jar3dZljB2/+AKfdss6ac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789242585; c=relaxed/simple; bh=PsYU9CBvT/QFtj/d/iERKOKY/EuAHWDjtIspMqvTUfw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W4riXiGjX4oUi0nCwrVHZK8mpQbYDshQqCrTgRxj2uGhPP8uqRPJ9SjymOuJVxsbcU7szUPFo3jcJX7KK080+YqhBKxvvL/U5Xbs259Osf7dL9UIO5EHjQ9VevK/dvbtUStPm/drWeCY8Y9Wxkkn0QWiX3HXr0QU9IWB6UEMNaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PelcH26O; 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="PelcH26O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 467F81F000FF; Sat, 12 Sep 2026 19:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789242583; bh=hyaKe00yncPtygWk2cd+zSG51B1PXtuiF1bkaWNzz2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PelcH26Owzp+p6y/oo3wJ7mIjp5MIy5RIFTdxxKBLaBfcuocFOsCul4UiopDOj+rK wDe66qj6oFg7SetVGD+NgpbL2Xe24H4chJlCYrdJ/nwYfWTz7yCZZ976RbwnZOmM01 t7dyYbbStrUu9QnZVqTda840/t5CsqdjLtzWyv5Y= 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.10 454/798] ACPI: move from strlcpy() with unused retval to strscpy() Date: Sat, 12 Sep 2026 09:01:22 +0200 Message-ID: <20260912065527.549486212@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065516.948645775@linuxfoundation.org> References: <20260912065516.948645775@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.10-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 60dfe63301d00..11cbe02da3dc4 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -681,7 +681,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; } @@ -701,7 +701,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 cf824841ffead..e6358b1f9ac14 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -801,7 +801,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; @@ -968,7 +968,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; @@ -1034,7 +1034,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; @@ -1210,7 +1210,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 ddca1550cce6f..e6e0aba1a8552 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -832,7 +832,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; @@ -863,7 +863,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; @@ -901,7 +901,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