Skip to content

Commit 38db82e

Browse files
ye xingchendavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 27e521c commit 38db82e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ipa/ipa_sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ version_show(struct device *dev, struct device_attribute *attr, char *buf)
4646
{
4747
struct ipa *ipa = dev_get_drvdata(dev);
4848

49-
return scnprintf(buf, PAGE_SIZE, "%s\n", ipa_version_string(ipa));
49+
return sysfs_emit(buf, "%s\n", ipa_version_string(ipa));
5050
}
5151

5252
static DEVICE_ATTR_RO(version);
@@ -70,7 +70,7 @@ static ssize_t rx_offload_show(struct device *dev,
7070
{
7171
struct ipa *ipa = dev_get_drvdata(dev);
7272

73-
return scnprintf(buf, PAGE_SIZE, "%s\n", ipa_offload_string(ipa));
73+
return sysfs_emit(buf, "%s\n", ipa_offload_string(ipa));
7474
}
7575

7676
static DEVICE_ATTR_RO(rx_offload);
@@ -80,7 +80,7 @@ static ssize_t tx_offload_show(struct device *dev,
8080
{
8181
struct ipa *ipa = dev_get_drvdata(dev);
8282

83-
return scnprintf(buf, PAGE_SIZE, "%s\n", ipa_offload_string(ipa));
83+
return sysfs_emit(buf, "%s\n", ipa_offload_string(ipa));
8484
}
8585

8686
static DEVICE_ATTR_RO(tx_offload);

0 commit comments

Comments
 (0)