diff options
author | ye xingchen <ye.xingchen@zte.com.cn> | 2023-01-17 10:40:26 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-02-09 20:39:48 +0100 |
commit | 5bbafd436266136a67224b98e6ad864c4ddd762d (patch) | |
tree | 5cb50fd506a168c2cba92ceb3d8138477121324c /drivers/thermal | |
parent | 9e0a9be24bdd61a160631227ee995b579be566a5 (diff) | |
download | lwn-5bbafd436266136a67224b98e6ad864c4ddd762d.tar.gz lwn-5bbafd436266136a67224b98e6ad864c4ddd762d.zip |
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>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/thermal_core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 0675df54c8e6..55679fd86505 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -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); |