Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 98fe0fc

Browse files
zhijianli88KAGA-KOKO
authored andcommitted
clockevents: 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-2-lizhijian@fujitsu.com
1 parent 8f0acb7 commit 98fe0fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/clockevents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ static ssize_t current_device_show(struct device *dev,
677677
raw_spin_lock_irq(&clockevents_lock);
678678
td = tick_get_tick_dev(dev);
679679
if (td && td->evtdev)
680-
count = snprintf(buf, PAGE_SIZE, "%s\n", td->evtdev->name);
680+
count = sysfs_emit(buf, "%s\n", td->evtdev->name);
681681
raw_spin_unlock_irq(&clockevents_lock);
682682
return count;
683683
}

0 commit comments

Comments
 (0)