From: Khaled Elnaggar Date: Sat, 12 Jul 2025 13:14:46 +0000 (+0300) Subject: hwmon: (max31827) use sysfs_emit() in temp1_resolution_show() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1eb9fe14e73dc2ca47fd3c2f9f3c8753e33b774;p=thirdparty%2Fkernel%2Flinux.git hwmon: (max31827) use sysfs_emit() in temp1_resolution_show() Replace scnprintf() with sysfs_emit() in temp1_resolution_show(), as recommended in Documentation/filesystems/sysfs.rst: show() callbacks should use sysfs_emit() or sysfs_emit_at() to format values returned to userspace. Signed-off-by: Khaled Elnaggar Link: https://lore.kernel.org/r/20250712131447.326995-1-khaledelnaggarlinux@gmail.com Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/max31827.c b/drivers/hwmon/max31827.c index 48e8f8ba4d05b..a31c7b655da13 100644 --- a/drivers/hwmon/max31827.c +++ b/drivers/hwmon/max31827.c @@ -445,7 +445,7 @@ static ssize_t temp1_resolution_show(struct device *dev, val = FIELD_GET(MAX31827_CONFIGURATION_RESOLUTION_MASK, val); - return scnprintf(buf, PAGE_SIZE, "%u\n", max31827_resolutions[val]); + return sysfs_emit(buf, "%u\n", max31827_resolutions[val]); } static ssize_t temp1_resolution_store(struct device *dev,