* [PATCH linux-next ] mm: vmscan: use sysfs_emit() to instead of scnprintf()
@ 2022-11-24 11:29 yang.yang29
0 siblings, 0 replies; only message in thread
From: yang.yang29 @ 2022-11-24 11:29 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, xu.panda, yang.yang29
From: Xu Panda <xu.panda@zte.com.cn>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1147034c86a2..ac494806ee51 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -5404,7 +5404,7 @@ static ssize_t show_enabled(struct kobject *kobj, struct kobj_attribute *attr, c
if (IS_ENABLED(CONFIG_ARCH_HAS_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 */
--
2.15.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-24 11:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24 11:29 [PATCH linux-next ] mm: vmscan: use sysfs_emit() to instead of scnprintf() yang.yang29
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.