summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorLi Zhijian <lizhijian@fujitsu.com>2024-03-14 18:04:02 +0800
committerThomas Gleixner <tglx@linutronix.de>2024-04-09 12:32:37 +0200
commit98fe0fcb326a923740cb8900aa7ed7fe538c984a (patch)
tree1a324e4308dd88f7a13d0b5edb228d109060a3c3 /kernel/time
parent8f0acb7f3a1331559e325566c00c26d1523dfe06 (diff)
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
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clockevents.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index a7ca458cdd9c..60a6484831b1 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -677,7 +677,7 @@ static ssize_t current_device_show(struct device *dev,
raw_spin_lock_irq(&clockevents_lock);
td = tick_get_tick_dev(dev);
if (td && td->evtdev)
- count = snprintf(buf, PAGE_SIZE, "%s\n", td->evtdev->name);
+ count = sysfs_emit(buf, "%s\n", td->evtdev->name);
raw_spin_unlock_irq(&clockevents_lock);
return count;
}