From 256b734efc7494eb3c45f3ff5abd632ff0afde03 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Fri, 2 Dec 2022 16:56:04 +0800 Subject: platform/chrome: use sysfs_emit() instead of scnprintf() 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: ye xingchen Link: https://lore.kernel.org/r/202212021656040995199@zte.com.cn [tzungbi: fixed the commit message.] Signed-off-by: Tzung-Bi Shih --- drivers/platform/chrome/wilco_ec/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/platform/chrome/wilco_ec') diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c index 79a5e8fa680f..893c59dde32a 100644 --- a/drivers/platform/chrome/wilco_ec/sysfs.c +++ b/drivers/platform/chrome/wilco_ec/sysfs.c @@ -119,8 +119,7 @@ static ssize_t get_info(struct device *dev, char *buf, enum get_ec_info_op op) if (ret < 0) return ret; - return scnprintf(buf, PAGE_SIZE, "%.*s\n", (int)sizeof(resp.value), - (char *)&resp.value); + return sysfs_emit(buf, "%.*s\n", (int)sizeof(resp.value), (char *)&resp.value); } static ssize_t version_show(struct device *dev, struct device_attribute *attr, -- cgit v1.2.3