sfc: use sysfs_emit() to instead of scnprintf()
Subsystems (3)
PATCH v2 1/1 sfc: use sysfs_emit() to instead of scnprintf()
From: ye xingchen <[email protected]>
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.
---
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(-)
drivers/net/ethernet/sfc/efx_common.c +1 -1
@@ -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,
drivers/net/ethernet/sfc/siena/efx_common.c +1 -1
@@ -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,
Signature · 1 line
2.25.1
Quoted 6 lines · On Mon, Dec 05, 2022 at 10:21:45AM +0800, [email protected] wrote:
From: ye xingchen <[email protected]>
Follow the advice of the
Documentation/filesystems/sysfs.rstandshow()should only usesysfs_emit()orsysfs_emit_at()when formatting the value to be returned to user space.
Quoted 8 lines
Signed-off-by ye xingchen <[email protected]>---
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,
Quoted 7 lines · On Mon, Dec 05, 2022 at 10:21:45AM +0800, [email protected] wrote:
From: ye xingchen <[email protected]>
Follow the advice of the
Documentation/filesystems/sysfs.rstandshow()should only usesysfs_emit()orsysfs_emit_at()when formatting the value to be returned to user space.Signed-off-by ye xingchen <[email protected]>
Quoted 35 lines
---
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(-)drivers/net/ethernet/sfc/efx_common.c +1
-1@@ -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,drivers/net/ethernet/sfc/siena/efx_common.c +1
-1@@ -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,Signature · 1 line
2.25.1
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 5 Dec 2022 10:21:45 +0800 (CST) you wrote:
From: ye xingchen <[email protected]>
Follow the advice of the
Documentation/filesystems/sysfs.rstandshow()should only usesysfs_emit()orsysfs_emit_at()when formatting the value to be returned to user space.Signed-off-by ye xingchen <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html