Skip to contentSkip to conversation

hwmon: max31827: use sysfs_emit() in temp1_resolution_show()

PATCH Applied Khaled Elnaggar 2 participants 2 messages Jul 12, 2025 – Jul 16, 2025 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/hwmon/max31827.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max31827.c +1 -1
index 48e8f8ba4d05..c423cabcb28b 100644
@@ -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,

--
2.47.2

maintainer Applied
#1 lore raw
Quoted 6 lines · Khaled Elnaggar

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.

Applied.

Thanks,
Guenter