]> git.ipfire.org Git - thirdparty/linux.git/commit
platform/x86: intel/pmt: Replace sprintf() with sysfs_emit()
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>
Thu, 18 Dec 2025 07:48:33 +0000 (13:18 +0530)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 23 Dec 2025 09:27:56 +0000 (11:27 +0200)
commitdd0a2d47cfc4c5ffb3e866c94a80c03ff5ecdd70
treefde013cb96a247f7a555a93ddd4ea2e638640653
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
platform/x86: intel/pmt: Replace sprintf() with sysfs_emit()

Replace sprintf() calls with sysfs_emit() in guid_show(), size_show(),
and offset_show() sysfs attribute handlers. The sysfs_emit() function
provides automatic buffer bounds checking and is the preferred method
for formatting sysfs output per Documentation/filesystems/sysfs.rst.

This improves safety by preventing potential buffer overflows and aligns
with current kernel coding standards for sysfs attribute implementation.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Link: https://patch.msgid.link/20251218074833.2948801-1-kaushlendra.kumar@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/pmt/class.c