The patch titled Subject: mm/memory-failure: replace sprintf() with sysfs_emit() has been added to the -mm mm-unstable branch. Its filename is mm-memory-failure-replace-sprintf-with-sysfs_emit.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-memory-failure-replace-sprintf-with-sysfs_emit.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: zhangguopeng <zhangguopeng@xxxxxxxxxx> Subject: mm/memory-failure: replace sprintf() with sysfs_emit() Date: Tue, 29 Oct 2024 18:18:53 +0800 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@xxxxxxxxxx Signed-off-by: zhangguopeng <zhangguopeng@xxxxxxxxxx> Cc: Miaohe Lin <linmiaohe@xxxxxxxxxx> Cc: Naoya Horiguchi <nao.horiguchi@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memory-failure.c~mm-memory-failure-replace-sprintf-with-sysfs_emit +++ a/mm/memory-failure.c @@ -100,7 +100,7 @@ static ssize_t _name##_show(struct devic { \ 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) _ Patches currently in -mm which might be from zhangguopeng@xxxxxxxxxx are mm-memory-failure-replace-sprintf-with-sysfs_emit.patch