Skip to content

Commit 5bbafd4

Browse files
ye xingchenrafaeljw
authored andcommitted
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 <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9e0a9be commit 5bbafd4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/thermal/thermal_core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,9 @@ int thermal_build_list_of_policies(char *buf)
229229
mutex_lock(&thermal_governor_lock);
230230

231231
list_for_each_entry(pos, &thermal_governor_list, governor_list) {
232-
count += scnprintf(buf + count, PAGE_SIZE - count, "%s ",
233-
pos->name);
232+
count += sysfs_emit_at(buf, count, "%s ", pos->name);
234233
}
235-
count += scnprintf(buf + count, PAGE_SIZE - count, "\n");
234+
count += sysfs_emit_at(buf, count, "\n");
236235

237236
mutex_unlock(&thermal_governor_lock);
238237

0 commit comments

Comments
 (0)