From nobody Sat Feb 7 15:10:43 2026 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 691BA37F0E9 for ; Mon, 12 Jan 2026 17:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768240165; cv=none; b=aZ4A/wwNd+N/XTjrV4ji2x44jzeLJrlvOJXFd/Hh5VX9dTo0IastVbklM9Nm5pdrLw4OPTlulskIHfhN1W6bKSz6cEIybwLnD2ucxQSUO/+05XnV42xBxqFHxyJNOHtap9tlNu544e+okXYlycNpVoH8Kx23xz2YnBZssSTX9lU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768240165; c=relaxed/simple; bh=DaG0mNPrxt7UxX6d1AEb9UeNXobR3jM4FbsaSZNzERY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V1HLB3dGcPniepKNEW7t6YrgwqAMdqLUIPyQvgmd+VO218eD0WgN8gXDt6Z1HPIJM+vXuMlrdDzbzStqmMQkiNF7Qfr5phWJp2kEFXOEvncuopA12BbosdkrpCeKw4+mSTr1fvWRui8UKRcV90RQRGD8DjU0Daq4c2r2Ei816fk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=DPxj+ooK; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="DPxj+ooK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768240150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ptdK7BGnIMVl85BczoM9exnt2HtNdeSM/ljiCxt5DbQ=; b=DPxj+ooK4AEZU0Vkqi/WtVqofVMcdOTvM6bUyFlhagL9PeZVJUUFMBD6GldYnK6vj7nr+Y pxp3IIfZlo9D4JEoeB09HnMR8PpFLRnLQWBEBVO2eAYbC67HvPTtc1PSLDgel3fbiUslho ovrBGcCfLqdJ+vVYYM+c8Sq0vexszYI= From: Thorsten Blum To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba Cc: Thorsten Blum , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: sysfs: Replace snprintf with strscpy in policy_store Date: Mon, 12 Jan 2026 18:49:00 +0100 Message-ID: <20260112174901.767434-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" There is no need to use snprintf with a format specifier to copy 'buf' to 'name'; use strscpy() directly instead. Signed-off-by: Thorsten Blum --- drivers/thermal/thermal_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysf= s.c index d80612506a33..e9580ddf4882 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -199,7 +199,7 @@ policy_store(struct device *dev, struct device_attribut= e *attr, char name[THERMAL_NAME_LENGTH]; int ret; =20 - snprintf(name, sizeof(name), "%s", buf); + strscpy(name, buf); =20 ret =3D thermal_zone_device_set_policy(tz, name); if (!ret) --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4