mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 00:32:00 +00:00
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/20241029101853.37890-1-zhangguopeng@kylinos.cn Signed-off-by: zhangguopeng <zhangguopeng@kylinos.cn> Acked-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Naoya Horiguchi <nao.horiguchi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
f914ac96ee
commit
408a8dc623
@ -100,7 +100,7 @@ static ssize_t _name##_show(struct device *dev, \
|
||||
{ \
|
||||
struct memory_failure_stats *mf_stats = \
|
||||
&NODE_DATA(dev->id)->mf_stats; \
|
||||
return sprintf(buf, "%lu\n", mf_stats->_name); \
|
||||
return sysfs_emit(buf, "%lu\n", mf_stats->_name); \
|
||||
} \
|
||||
static DEVICE_ATTR_RO(_name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user