Skip to content

Commit 763bd29

Browse files
ye xingchenrafaeljw
authored andcommitted
thermal: int340x_thermal: Use sysfs_emit_at() instead of scnprintf()
Follow the advice of the 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 rewrite ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a30e657 commit 763bd29

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ static ssize_t available_uuids_show(struct device *dev,
130130

131131
for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
132132
if (priv->uuid_bitmap & (1 << i))
133-
length += scnprintf(&buf[length],
134-
PAGE_SIZE - length,
135-
"%s\n",
136-
int3400_thermal_uuids[i]);
133+
length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]);
137134
}
138135

139136
return length;
@@ -151,10 +148,7 @@ static ssize_t current_uuid_show(struct device *dev,
151148

152149
for (i = 0; i <= INT3400_THERMAL_CRITICAL; i++) {
153150
if (priv->os_uuid_mask & BIT(i))
154-
length += scnprintf(&buf[length],
155-
PAGE_SIZE - length,
156-
"%s\n",
157-
int3400_thermal_uuids[i]);
151+
length += sysfs_emit_at(buf, length, int3400_thermal_uuids[i]);
158152
}
159153

160154
if (length)

0 commit comments

Comments
 (0)