[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLi=WNXhDJPD-bt5cm46bBDZRn=8ZbDCQfE0juO_32SDuAQ@mail.gmail.com>
Date: Mon, 21 Oct 2024 13:25:57 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Rosen Penev <rosenp@...il.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: bnxt: use ethtool string helpers
On Sun, Oct 20, 2024 at 7:29 PM Rosen Penev <rosenp@...il.com> wrote:
>
> Avoids having to use manual pointer manipulation.
>
> Signed-off-by: Rosen Penev <rosenp@...il.com>
> ---
> .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 110 ++++++++----------
> 1 file changed, 50 insertions(+), 60 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index f71cc8188b4e..84d468ad3c8e 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -713,18 +713,17 @@ static void bnxt_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
> for (i = 0; i < bp->cp_nr_rings; i++) {
> if (is_rx_ring(bp, i)) {
> num_str = NUM_RING_RX_HW_STATS;
> - for (j = 0; j < num_str; j++) {
> - sprintf(buf, "[%d]: %s", i,
> + for (j = 0; j < num_str; j++)
> + ethtool_sprintf(
> + &buf, "[%d]: %s", i,
If you combine this line with the line above, I think it will look better:
ethtool_sprintf(&buf, "[%d]: %s", i,
checkpatch.pl may warn because the next line won't line up, but I
think it will look better and it reduces the number of lines. The
same comment applies to other similar spots in the patch. Thanks.
> bnxt_ring_rx_stats_str[j]);
> - buf += ETH_GSTRING_LEN;
> - }
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists