diff options
author | ye xingchen <ye.xingchen@zte.com.cn> | 2022-12-02 09:42:14 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-05 12:03:49 +0100 |
commit | 38db82e29404d462b71bc3ac2149fbaf0c41fc7c (patch) | |
tree | b5c2afce29a5dd55055ba0b2cbe40ed2a011bc2f /drivers/net/ipa/ipa_sysfs.c | |
parent | Merge tag 'rxrpc-next-20221201-b' of git://git.kernel.org/pub/scm/linux/kerne... (diff) | |
download | linux-38db82e29404d462b71bc3ac2149fbaf0c41fc7c.tar.xz linux-38db82e29404d462b71bc3ac2149fbaf0c41fc7c.zip |
net: ipa: use sysfs_emit() to instead of scnprintf()
Follow the advice of the Documentation/filesystems/sysfs.rst and 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>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ipa/ipa_sysfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ipa/ipa_sysfs.c b/drivers/net/ipa/ipa_sysfs.c index 5cbc15a971f9..14bd2f903045 100644 --- a/drivers/net/ipa/ipa_sysfs.c +++ b/drivers/net/ipa/ipa_sysfs.c @@ -46,7 +46,7 @@ version_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ipa *ipa = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%s\n", ipa_version_string(ipa)); + return sysfs_emit(buf, "%s\n", ipa_version_string(ipa)); } static DEVICE_ATTR_RO(version); @@ -70,7 +70,7 @@ static ssize_t rx_offload_show(struct device *dev, { struct ipa *ipa = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%s\n", ipa_offload_string(ipa)); + return sysfs_emit(buf, "%s\n", ipa_offload_string(ipa)); } static DEVICE_ATTR_RO(rx_offload); @@ -80,7 +80,7 @@ static ssize_t tx_offload_show(struct device *dev, { struct ipa *ipa = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%s\n", ipa_offload_string(ipa)); + return sysfs_emit(buf, "%s\n", ipa_offload_string(ipa)); } static DEVICE_ATTR_RO(tx_offload); |