diff options
author | ye xingchen <ye.xingchen@zte.com.cn> | 2022-12-02 11:56:04 +0300 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-12-26 06:14:34 +0300 |
commit | 256b734efc7494eb3c45f3ff5abd632ff0afde03 (patch) | |
tree | d6086462cc59b07d7c9367fa24714cf20d719da1 /drivers/platform/chrome/wilco_ec | |
parent | 1b929c02afd37871d5afb9d498426f83432e71c2 (diff) | |
download | linux-256b734efc7494eb3c45f3ff5abd632ff0afde03.tar.xz |
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 <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212021656040995199@zte.com.cn
[tzungbi: fixed the commit message.]
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/platform/chrome/wilco_ec')
-rw-r--r-- | drivers/platform/chrome/wilco_ec/sysfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
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, |