mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
thermal: core: Use sysfs_emit_at() instead of scnprintf()
Follow the advice in Documentation/filesystems/sysfs.rst that show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
9e0a9be24b
commit
5bbafd4362
@ -229,10 +229,9 @@ int thermal_build_list_of_policies(char *buf)
|
||||
mutex_lock(&thermal_governor_lock);
|
||||
|
||||
list_for_each_entry(pos, &thermal_governor_list, governor_list) {
|
||||
count += scnprintf(buf + count, PAGE_SIZE - count, "%s ",
|
||||
pos->name);
|
||||
count += sysfs_emit_at(buf, count, "%s ", pos->name);
|
||||
}
|
||||
count += scnprintf(buf + count, PAGE_SIZE - count, "\n");
|
||||
count += sysfs_emit_at(buf, count, "\n");
|
||||
|
||||
mutex_unlock(&thermal_governor_lock);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user