[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <769f3405-9905-4a26-ba8a-baf30e591f54@engleder-embedded.com>
Date: Fri, 11 Oct 2024 22:17:59 +0200
From: Gerhard Engleder <gerhard@...leder-embedded.com>
To: Rosen Penev <rosenp@...il.com>, netdev@...r.kernel.org
Cc: Felix Fietkau <nbd@....name>, Sean Wang <sean.wang@...iatek.com>,
Mark Lee <Mark-MC.Lee@...iatek.com>, Lorenzo Bianconi <lorenzo@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
"open list:ARM/Mediatek SoC support" <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH] net: mtk_eth_soc: use ethtool_puts
On 11.10.24 22:02, Rosen Penev wrote:
> Allows simplifying get_strings and avoids manual pointer manipulation.
>
> Tested on Belkin RT1800.
>
> Signed-off-by: Rosen Penev <rosenp@...il.com>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 9aaaaa2a27dc..6d93f64f8748 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -4328,10 +4328,8 @@ static void mtk_get_strings(struct net_device *dev, u32 stringset, u8 *data)
> case ETH_SS_STATS: {
> struct mtk_mac *mac = netdev_priv(dev);
>
> - for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++) {
> - memcpy(data, mtk_ethtool_stats[i].str, ETH_GSTRING_LEN);
> - data += ETH_GSTRING_LEN;
> - }
> + for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++)
> + ethtool_puts(&data, mtk_ethtool_stats[i].str);
Reviewed-by: Gerhard Engleder <gerhard@...leder-embedded.com>
Powered by blists - more mailing lists