* [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf()
@ 2022-12-05 2:21 ye.xingchen
2022-12-05 7:47 ` Leon Romanovsky
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: ye.xingchen @ 2022-12-05 2:21 UTC (permalink / raw)
To: leon, davem
Cc: ecree.xilinx, habetsm.xilinx, edumazet, kuba, pabeni, petrm,
khalasa, shayagr, wsa+renesas, netdev, linux-kernel
From: ye xingchen <ye.xingchen@zte.com.cn>
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>
---
v1 -> v2
Fix the Subject.
drivers/net/ethernet/sfc/efx_common.c | 2 +-
drivers/net/ethernet/sfc/siena/efx_common.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index c2224e41a694..cc30524c2fe4 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -1164,7 +1164,7 @@ static ssize_t mcdi_logging_show(struct device *dev,
struct efx_nic *efx = dev_get_drvdata(dev);
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
- return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled);
+ return sysfs_emit(buf, "%d\n", mcdi->logging_enabled);
}
static ssize_t mcdi_logging_store(struct device *dev,
diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c
index 1fd396b00bfb..e4b294b8e9ac 100644
--- a/drivers/net/ethernet/sfc/siena/efx_common.c
+++ b/drivers/net/ethernet/sfc/siena/efx_common.c
@@ -1178,7 +1178,7 @@ static ssize_t mcdi_logging_show(struct device *dev,
struct efx_nic *efx = dev_get_drvdata(dev);
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
- return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled);
+ return sysfs_emit(buf, "%d\n", mcdi->logging_enabled);
}
static ssize_t mcdi_logging_store(struct device *dev,
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf()
2022-12-05 2:21 [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf() ye.xingchen
@ 2022-12-05 7:47 ` Leon Romanovsky
2022-12-06 8:55 ` Martin Habets
2022-12-07 4:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2022-12-05 7:47 UTC (permalink / raw)
To: ye.xingchen
Cc: davem, ecree.xilinx, habetsm.xilinx, edumazet, kuba, pabeni,
petrm, khalasa, shayagr, wsa+renesas, netdev, linux-kernel
On Mon, Dec 05, 2022 at 10:21:45AM +0800, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> 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>
> ---
> v1 -> v2
> Fix the Subject.
> drivers/net/ethernet/sfc/efx_common.c | 2 +-
> drivers/net/ethernet/sfc/siena/efx_common.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf()
2022-12-05 2:21 [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-05 7:47 ` Leon Romanovsky
@ 2022-12-06 8:55 ` Martin Habets
2022-12-07 4:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Martin Habets @ 2022-12-06 8:55 UTC (permalink / raw)
To: ye.xingchen
Cc: leon, davem, ecree.xilinx, edumazet, kuba, pabeni, petrm, khalasa,
shayagr, wsa+renesas, netdev, linux-kernel
On Mon, Dec 05, 2022 at 10:21:45AM +0800, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> 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>
Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
> ---
> v1 -> v2
> Fix the Subject.
> drivers/net/ethernet/sfc/efx_common.c | 2 +-
> drivers/net/ethernet/sfc/siena/efx_common.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
> index c2224e41a694..cc30524c2fe4 100644
> --- a/drivers/net/ethernet/sfc/efx_common.c
> +++ b/drivers/net/ethernet/sfc/efx_common.c
> @@ -1164,7 +1164,7 @@ static ssize_t mcdi_logging_show(struct device *dev,
> struct efx_nic *efx = dev_get_drvdata(dev);
> struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
>
> - return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled);
> + return sysfs_emit(buf, "%d\n", mcdi->logging_enabled);
> }
>
> static ssize_t mcdi_logging_store(struct device *dev,
> diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c
> index 1fd396b00bfb..e4b294b8e9ac 100644
> --- a/drivers/net/ethernet/sfc/siena/efx_common.c
> +++ b/drivers/net/ethernet/sfc/siena/efx_common.c
> @@ -1178,7 +1178,7 @@ static ssize_t mcdi_logging_show(struct device *dev,
> struct efx_nic *efx = dev_get_drvdata(dev);
> struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
>
> - return scnprintf(buf, PAGE_SIZE, "%d\n", mcdi->logging_enabled);
> + return sysfs_emit(buf, "%d\n", mcdi->logging_enabled);
> }
>
> static ssize_t mcdi_logging_store(struct device *dev,
> --
> 2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf()
2022-12-05 2:21 [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-05 7:47 ` Leon Romanovsky
2022-12-06 8:55 ` Martin Habets
@ 2022-12-07 4:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-07 4:50 UTC (permalink / raw)
To: ye.xingchen
Cc: leon, davem, ecree.xilinx, habetsm.xilinx, edumazet, kuba, pabeni,
petrm, khalasa, shayagr, wsa+renesas, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 5 Dec 2022 10:21:45 +0800 (CST) you wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> 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>
>
> [...]
Here is the summary with links:
- [net-next,v2] sfc: use sysfs_emit() to instead of scnprintf()
https://git.kernel.org/netdev/net-next/c/1ab586f5177b
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] 4+ messages in thread
end of thread, other threads:[~2022-12-07 4:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05 2:21 [PATCH net-next v2] sfc: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-05 7:47 ` Leon Romanovsky
2022-12-06 8:55 ` Martin Habets
2022-12-07 4:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).