提交 5bbafd43 编写于 作者: Y ye xingchen 提交者: Rafael J. Wysocki

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: Nye xingchen <ye.xingchen@zte.com.cn>
[ rjw: Subject and changelog edits ]
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 9e0a9be2
...@@ -229,10 +229,9 @@ int thermal_build_list_of_policies(char *buf) ...@@ -229,10 +229,9 @@ int thermal_build_list_of_policies(char *buf)
mutex_lock(&thermal_governor_lock); mutex_lock(&thermal_governor_lock);
list_for_each_entry(pos, &thermal_governor_list, governor_list) { list_for_each_entry(pos, &thermal_governor_list, governor_list) {
count += scnprintf(buf + count, PAGE_SIZE - count, "%s ", count += sysfs_emit_at(buf, count, "%s ", pos->name);
pos->name);
} }
count += scnprintf(buf + count, PAGE_SIZE - count, "\n"); count += sysfs_emit_at(buf, count, "\n");
mutex_unlock(&thermal_governor_lock); mutex_unlock(&thermal_governor_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册