All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dsa: Use sysfs_emit() to instead of sprintf()
@ 2023-02-01  8:14 Bo Liu
  2023-02-02 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Bo Liu @ 2023-02-01  8:14 UTC (permalink / raw)
  To: andrew, f.fainelli, olteanv, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Bo Liu

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: Bo Liu <liubo03@inspur.com>
---
 net/dsa/master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/master.c b/net/dsa/master.c
index 26d90140d271..dcbd88fe4281 100644
--- a/net/dsa/master.c
+++ b/net/dsa/master.c
@@ -299,7 +299,7 @@ static ssize_t tagging_show(struct device *d, struct device_attribute *attr,
 	struct net_device *dev = to_net_dev(d);
 	struct dsa_port *cpu_dp = dev->dsa_ptr;
 
-	return sprintf(buf, "%s\n",
+	return sysfs_emit(buf, "%s\n",
 		       dsa_tag_protocol_to_str(cpu_dp->tag_ops));
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: dsa: Use sysfs_emit() to instead of sprintf()
  2023-02-01  8:14 [PATCH] net: dsa: Use sysfs_emit() to instead of sprintf() Bo Liu
@ 2023-02-02 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-02 14:40 UTC (permalink / raw)
  To: Bo Liu
  Cc: andrew, f.fainelli, olteanv, davem, edumazet, kuba, pabeni,
	netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 1 Feb 2023 03:14:38 -0500 you wrote:
> 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: Bo Liu <liubo03@inspur.com>
> ---
>  net/dsa/master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - net: dsa: Use sysfs_emit() to instead of sprintf()
    https://git.kernel.org/netdev/net-next/c/b18ea3d9d214

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-02 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01  8:14 [PATCH] net: dsa: Use sysfs_emit() to instead of sprintf() Bo Liu
2023-02-02 14:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.