ACPI: fan: Replace sprintf()/scnprintf() with sysfs_emit() in show() functions
authorAbdelrahman Fekry <abdelrahmanfekry375@gmail.com>
Sat, 21 Jun 2025 05:52:00 +0000 (08:52 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 2 Jul 2025 17:57:28 +0000 (19:57 +0200)
commit66c1f381d8b3282a191e8d93faac938647dfbc70
tree010a714bc7bf3bd3d1bb866ddb186b57eb319a4d
parentd0b3b7b22dfa1f4b515fd3a295b3fd958f9e81af
ACPI: fan: Replace sprintf()/scnprintf() with sysfs_emit() in show() functions

Update two sysfs show() functions in the ACPI fan driver to use sysfs_emit()
and sysfs_emit_at() instead of sprintf() and scnprintf().

 - show_fan_speed(): replaced sprintf() with sysfs_emit().
 - show_state(): replaced scnprintf() with sysfs_emit() for the first
   write, and retained sysfs_emit_at() for incremental writes.

This change is in accordance with Documentation/filesystems/sysfs.rst,
which recommends using sysfs_emit/sysfs_emit_at in all sysfs show()
callbacks for buffer safety, clarity, and consistency.

Signed-off-by: Abdelrahman Fekry <abdelrahmanfekry375@gmail.com>
Link: https://patch.msgid.link/20250621055200.166361-1-abdelrahmanfekry375@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/fan_attr.c