Skip to content

Commit 408a8dc

Browse files
zhangguopengakpm00
authored andcommitted
mm/memory-failure: replace sprintf() with sysfs_emit()
As Documentation/filesystems/sysfs.rst suggested, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: zhangguopeng <[email protected]> Acked-by: Miaohe Lin <[email protected]> Cc: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f914ac9 commit 408a8dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memory-failure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static ssize_t _name##_show(struct device *dev, \
100100
{ \
101101
struct memory_failure_stats *mf_stats = \
102102
&NODE_DATA(dev->id)->mf_stats; \
103-
return sprintf(buf, "%lu\n", mf_stats->_name); \
103+
return sysfs_emit(buf, "%lu\n", mf_stats->_name); \
104104
} \
105105
static DEVICE_ATTR_RO(_name)
106106

0 commit comments

Comments
 (0)