From nobody Sat Feb 7 15:09:50 2026 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 275F637FF5E for ; Tue, 13 Jan 2026 08:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768292536; cv=none; b=Y7fomkfnHdYcIX9+MGTa3J9e+HBx18Oit8F+6IbEqmftDhMftfZenY9q7SD7lpfPL2iI+6UQ0/k0wUb/A+0cWvFpqp9ll4y9xIDLTWbchdEvoMn7i0FZnmnUEtf5hIn/DFVukZY0Jes7Ny0GBgAYb905rrPVaQeDt5+ommdO+pA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768292536; c=relaxed/simple; bh=QYy017ud3X2P8zyxkN25/LzHClPAXOl0t8j6t1rie7M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Lad4RmHt8+YTM/dvKT4zzVxeSQevw8QH4bpPsGKLqq07x+RkvTeqX1VI1WKEamRaUm7/7DQRS0vUXrLj1Q+z9CKTTg93zZLi+AvQADK1x3aODv2W3Yqbqz4E7Zpv+R4PDGUnYxT+/8b2Yrw2j1KNMFY1PVJGQFF6djKrdmay3ts= 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=Smo0LM5a; arc=none smtp.client-ip=95.215.58.182 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="Smo0LM5a" 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=1768292532; 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=In6W7QGhm3hj4MpGLTokEuKe9UtWFKLeItnsJKhhMtI=; b=Smo0LM5aT8zumZTrS7MKh3ETKajkG2popBoIZJQlSrTTXPLWdihPVlqpJrh3Ix9ibPI40F +m/V047SY3t2OGU/iHl1oozpP7/V8gje9sXvD+4OMd01GPyzYqy3VVL14vLv8u1hp8tNGV TyVpPnoWBIm++Nufp5N2yQ/D7Xsx0Po= From: Thorsten Blum To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , "Peter Zijlstra (Intel)" , Ingo Molnar Cc: Thorsten Blum , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: intel: Use sysfs_emit in sysfs show functions Date: Tue, 13 Jan 2026 09:21:26 +0100 Message-ID: <20260113082130.789891-2-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" Replace sprintf() with sysfs_emit() in sysfs show functions. sysfs_emit() is preferred to format sysfs output as it provides better bounds checking. Signed-off-by: Thorsten Blum --- drivers/thermal/intel/therm_throt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/th= erm_throt.c index debc94e2dc16..44fa4dd15dd1 100644 --- a/drivers/thermal/intel/therm_throt.c +++ b/drivers/thermal/intel/therm_throt.c @@ -23,6 +23,7 @@ #include #include #include +#include #include =20 #include @@ -144,8 +145,8 @@ static ssize_t therm_throt_device_show_##event##_##name= ( \ \ preempt_disable(); /* CPU hotplug */ \ if (cpu_online(cpu)) { \ - ret =3D sprintf(buf, "%lu\n", \ - per_cpu(thermal_state, cpu).event.name); \ + ret =3D sysfs_emit(buf, "%lu\n", \ + per_cpu(thermal_state, cpu).event.name); \ } else \ ret =3D 0; \ preempt_enable(); \ --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4