Skip to content

Commit d1eb9fe

Browse files
Khaled Elnaggargroeck
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 9f4401a commit d1eb9fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwmon/max31827.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ static ssize_t temp1_resolution_show(struct device *dev,
445445

446446
val = FIELD_GET(MAX31827_CONFIGURATION_RESOLUTION_MASK, val);
447447

448-
return scnprintf(buf, PAGE_SIZE, "%u\n", max31827_resolutions[val]);
448+
return sysfs_emit(buf, "%u\n", max31827_resolutions[val]);
449449
}
450450

451451
static ssize_t temp1_resolution_store(struct device *dev,

0 commit comments

Comments
 (0)