From: Amay Agarwal Date: Tue, 3 Mar 2026 15:24:55 +0000 (+0530) Subject: hwmon: (max6650) Replace sprintf() with sysfs_emit() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9d468ba1bf222e61f886b46748696cd940e43a4;p=thirdparty%2Fkernel%2Flinux.git hwmon: (max6650) Replace sprintf() with sysfs_emit() Replace sprintf() with sysfs_emit() when writing to sysfs buffers. sysfs_emit() performs proper bounds checking and is the preferred helper for sysfs output. No functional change intended. Signed-off-by: Amay Agarwal Link: https://lore.kernel.org/r/20260303152456.35763-5-tt@turingtested.xyz Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 9649c6611d5f7..56b8157885bbf 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c @@ -27,6 +27,7 @@ #include #include #include +#include #include /* @@ -312,7 +313,7 @@ static ssize_t alarm_show(struct device *dev, mutex_unlock(&data->update_lock); } - return sprintf(buf, "%d\n", alarm); + return sysfs_emit(buf, "%d\n", alarm); } static SENSOR_DEVICE_ATTR_RO(gpio1_alarm, alarm, MAX6650_ALRM_GPIO1);