diff mbox series

net: mvneta: use ethtool_puts

Message ID 20241011195955.7065-1-rosenp@gmail.com (mailing list archive)
State Accepted
Commit 9de722c144d2ee67fb227fc527effbe77cf3ce30
Delegated to: Netdev Maintainers
Headers show
Series net: mvneta: use ethtool_puts | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-10-12--12-00 (tests: 777)

Commit Message

Rosen Penev Oct. 11, 2024, 7:59 p.m. UTC
Allows simplifying get_strings and avoids manual pointer manipulation.

Tested on Turris Omnia.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Gerhard Engleder Oct. 11, 2024, 8:22 p.m. UTC | #1
On 11.10.24 21:59, Rosen Penev wrote:
> Allows simplifying get_strings and avoids manual pointer manipulation.
> 
> Tested on Turris Omnia.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>   drivers/net/ethernet/marvell/mvneta.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index fcd89c67094f..7bb781fb93b5 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -4795,11 +4795,9 @@ static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
>   		int i;
>   
>   		for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++)
> -			memcpy(data + i * ETH_GSTRING_LEN,
> -			       mvneta_statistics[i].name, ETH_GSTRING_LEN);
> +			ethtool_puts(&data, mvneta_statistics[i].name);
>   
>   		if (!pp->bm_priv) {
> -			data += ETH_GSTRING_LEN * ARRAY_SIZE(mvneta_statistics);

Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
patchwork-bot+netdevbpf@kernel.org Oct. 15, 2024, 1:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 11 Oct 2024 12:59:55 -0700 you wrote:
> Allows simplifying get_strings and avoids manual pointer manipulation.
> 
> Tested on Turris Omnia.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  drivers/net/ethernet/marvell/mvneta.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Here is the summary with links:
  - net: mvneta: use ethtool_puts
    https://git.kernel.org/netdev/net-next/c/9de722c144d2

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index fcd89c67094f..7bb781fb93b5 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4795,11 +4795,9 @@  static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
 		int i;
 
 		for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++)
-			memcpy(data + i * ETH_GSTRING_LEN,
-			       mvneta_statistics[i].name, ETH_GSTRING_LEN);
+			ethtool_puts(&data, mvneta_statistics[i].name);
 
 		if (!pp->bm_priv) {
-			data += ETH_GSTRING_LEN * ARRAY_SIZE(mvneta_statistics);
 			page_pool_ethtool_stats_get_strings(data);
 		}
 	}