diff options
author | Li Zhijian <lizhijian@fujitsu.com> | 2024-03-14 13:04:01 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-04-09 13:32:37 +0300 |
commit | 8f0acb7f3a1331559e325566c00c26d1523dfe06 (patch) | |
tree | df88a6546cea1c5449028f5786a318ace02fef4b /kernel/time | |
parent | d0304569fb019d1bcfbbbce1ce6df6b96f04079b (diff) | |
download | linux-8f0acb7f3a1331559e325566c00c26d1523dfe06.tar.xz |
clocksource: Convert s[n]printf() to sysfs_emit()
Per filesystems/sysfs.rst, show() should only use sysfs_emit() or
sysfs_emit_at() when formatting the value to be returned to user space.
coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240314100402.1326582-1-lizhijian@fujitsu.com
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/clocksource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 4d50d53ac719..d25ba49e313c 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -1334,7 +1334,7 @@ static ssize_t current_clocksource_show(struct device *dev, ssize_t count = 0; mutex_lock(&clocksource_mutex); - count = snprintf(buf, PAGE_SIZE, "%s\n", curr_clocksource->name); + count = sysfs_emit(buf, "%s\n", curr_clocksource->name); mutex_unlock(&clocksource_mutex); return count; |