Subject: Re: [PATCH net-next] net: broadcom: use ethtool string helpers

From: Jakub Kicinski <[email-masked]>
Date: Tue, 29 Oct 2024 17:37:47 -0700

On Tue, 29 Oct 2024 16:43:15 -0700 Rosen Penev wrote:
> > > -             memcpy(buf, bnx2x_tests_str_arr + start,
> > > -                    ETH_GSTRING_LEN * BNX2X_NUM_TESTS(bp));
> > > +             for (i = start; i < BNX2X_NUM_TESTS(bp); i++)
> > > +                     ethtool_puts(&buf, bnx2x_tests_str_arr[i]);  
> >
> > I don't think this is equivalent.  
> What's wrong here?

We used to copy ETH_GSTRING_LEN * BNX2X_NUM_TESTS(bp)
but i will no only go from start to BNX2X_NUM_TESTS(bp)
IOW the copied length is ETH_GSTRING_LEN * (BNX2X_NUM_TESTS(bp) - start)
No?