summaryrefslogtreecommitdiffstats
path: root/net/ethernet/eth.c
diff options
context:
space:
mode:
authorye xingchen <ye.xingchen@zte.com.cn>2022-12-05 12:18:56 +0100
committerJakub Kicinski <kuba@kernel.org>2022-12-08 05:02:44 +0100
commit16dc16d9f058dce7031ee8b850f10622b8b5fb14 (patch)
treeb7e53a2082666e47ed2c5a9dc57161573db7aa0d /net/ethernet/eth.c
parentMerge tag 'ieee802154-for-net-next-2022-12-05' of git://git.kernel.org/pub/sc... (diff)
downloadlinux-16dc16d9f058dce7031ee8b850f10622b8b5fb14.tar.xz
linux-16dc16d9f058dce7031ee8b850f10622b8b5fb14.zip
net: ethernet: 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: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/202212051918564721658@zte.com.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethernet/eth.c')
-rw-r--r--net/ethernet/eth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index e02daa74e833..2edc8b796a4e 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -398,7 +398,7 @@ EXPORT_SYMBOL(alloc_etherdev_mqs);
ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len)
{
- return scnprintf(buf, PAGE_SIZE, "%*phC\n", len, addr);
+ return sysfs_emit(buf, "%*phC\n", len, addr);
}
EXPORT_SYMBOL(sysfs_format_mac);