Skip to content

Commit

Permalink
mm: vmscan: use sysfs_emit() to instead of scnprintf()
Browse files Browse the repository at this point in the history
Replace open-coded snprintf() with sysfs_emit() to simplify the code.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Xu Panda <[email protected]>
Signed-off-by: Yang Yang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Xu Panda authored and akpm00 committed Nov 30, 2022
1 parent 7e25de7 commit 8ef9c32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -5407,7 +5407,7 @@ static ssize_t show_enabled(struct kobject *kobj, struct kobj_attribute *attr, c
if (arch_has_hw_nonleaf_pmd_young() && get_cap(LRU_GEN_NONLEAF_YOUNG))
caps |= BIT(LRU_GEN_NONLEAF_YOUNG);

return snprintf(buf, PAGE_SIZE, "0x%04x\n", caps);
return sysfs_emit(buf, "0x%04x\n", caps);
}

/* see Documentation/admin-guide/mm/multigen_lru.rst for details */
Expand Down

0 comments on commit 8ef9c32

Please sign in to comment.