netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mvneta: use ethtool_puts
@ 2024-10-11 19:59 Rosen Penev
  2024-10-11 20:22 ` Gerhard Engleder
  2024-10-15  1:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2024-10-11 19:59 UTC (permalink / raw)
  To: netdev
  Cc: Marcin Wojtas, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, open list

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);
 			page_pool_ethtool_stats_get_strings(data);
 		}
 	}
-- 
2.47.0


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

* Re: [PATCH] net: mvneta: use ethtool_puts
  2024-10-11 19:59 [PATCH] net: mvneta: use ethtool_puts Rosen Penev
@ 2024-10-11 20:22 ` Gerhard Engleder
  2024-10-15  1:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Gerhard Engleder @ 2024-10-11 20:22 UTC (permalink / raw)
  To: Rosen Penev, netdev
  Cc: Marcin Wojtas, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, open list



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>

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

* Re: [PATCH] net: mvneta: use ethtool_puts
  2024-10-11 19:59 [PATCH] net: mvneta: use ethtool_puts Rosen Penev
  2024-10-11 20:22 ` Gerhard Engleder
@ 2024-10-15  1:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-15  1:10 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, marcin.s.wojtas, davem, edumazet, kuba, pabeni,
	linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-10-15  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 19:59 [PATCH] net: mvneta: use ethtool_puts Rosen Penev
2024-10-11 20:22 ` Gerhard Engleder
2024-10-15  1:10 ` 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).