mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
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
This commit is contained in:
parent
d0304569fb
commit
8f0acb7f3a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user