Skip to content

Commit 8f0acb7

Browse files
zhijianli88KAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d030456 commit 8f0acb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/clocksource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ static ssize_t current_clocksource_show(struct device *dev,
13341334
ssize_t count = 0;
13351335

13361336
mutex_lock(&clocksource_mutex);
1337-
count = snprintf(buf, PAGE_SIZE, "%s\n", curr_clocksource->name);
1337+
count = sysfs_emit(buf, "%s\n", curr_clocksource->name);
13381338
mutex_unlock(&clocksource_mutex);
13391339

13401340
return count;

0 commit comments

Comments
 (0)