Skip to content

Commit 48e49af

Browse files
TomAi0Tzung-Bi Shih
authored andcommitted
platform/chrome: wilco_ec: use sysfs_emit() instead of sprintf()
Follow the advice in Documentation/filesystems/sysfs.rst: show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Ai Chao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 0bbac3f commit 48e49af

File tree

1 file changed

+1
-1
lines changed
  • drivers/platform/chrome/wilco_ec

1 file changed

+1
-1
lines changed

drivers/platform/chrome/wilco_ec/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static ssize_t usb_charge_show(struct device *dev,
192192
if (ret < 0)
193193
return ret;
194194

195-
return sprintf(buf, "%d\n", rs.val);
195+
return sysfs_emit(buf, "%d\n", rs.val);
196196
}
197197

198198
static ssize_t usb_charge_store(struct device *dev,

0 commit comments

Comments
 (0)