On 03.09.2025 06:08, Loktionov, Aleksandr wrote:
> 
> 
> > -----Original Message-----
> > From: Intel-wired-lan <[email protected]> On Behalf
> > Of Brahmajit Das
> > Sent: Tuesday, September 2, 2025 9:24 AM
> > To: [email protected]
> > Cc: [email protected]; Nguyen, Anthony L
> > <[email protected]>; [email protected]; intel-wired-
> > [email protected]; [email protected]; [email protected];
> > [email protected]; Kitszel, Przemyslaw
> > <[email protected]>
> > Subject: [Intel-wired-lan] [PATCH v2] net: intel: fm10k: Fix parameter
> > idx set but not used
> > 
> > Variable idx is set in the loop, but is never used resulting in dead
> > code. Building with GCC 16, which enables
> > -Werror=unused-but-set-parameter= by default results in build error.
> > This patch removes the idx parameter, since all the callers of the
> > fm10k_unbind_hw_stats_q as 0 as idx anyways.
> > 
> > Suggested-by: Vadim Fedorenko <[email protected]>
> > Signed-off-by: Brahmajit Das <[email protected]>
> > ---
> > changes in v2:
> >     - Removed the idx parameter, since all callers of
> >     fm10k_unbind_hw_stats_q passes idx as 0 anyways.
> > ---
> >  drivers/net/ethernet/intel/fm10k/fm10k_common.c | 5 ++---
> >  drivers/net/ethernet/intel/fm10k/fm10k_common.h | 2 +-
> >  drivers/net/ethernet/intel/fm10k/fm10k_pf.c     | 2 +-
> >  drivers/net/ethernet/intel/fm10k/fm10k_vf.c     | 2 +-
> >  4 files changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> > b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> > index f51a63fca513..1f919a50c765 100644
> > --- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> > +++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> > @@ -447,17 +447,16 @@ void fm10k_update_hw_stats_q(struct fm10k_hw
> > *hw, struct fm10k_hw_stats_q *q,
> >  /**
> >   *  fm10k_unbind_hw_stats_q - Unbind the queue counters from their
> > queues
> >   *  @q: pointer to the ring of hardware statistics queue
> > - *  @idx: index pointing to the start of the ring iteration
> >   *  @count: number of queues to iterate over
> >   *
> >   *  Function invalidates the index values for the queues so any
> > updates that
> >   *  may have happened are ignored and the base for the queue stats is
> > reset.
> >   **/
> The kernel-doc comment still mentions @idx.
> Everything else if fine.
> Reviewed-by: Aleksandr Loktionov <[email protected]>
> 
> 
Hi Aleksandr, can you please point out how I can remove the kernel-doc
comment. I thought removing the line
        @idx: index pointing to the start of the ring iteration
from fm10k_common.c would do that.

I'm open to sending in a v3 with any changes required.
> > -void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, u32
> > count)
> > +void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 count)
> >  {
> >     u32 i;
> > 
> > -   for (i = 0; i < count; i++, idx++, q++) {
> > +   for (i = 0; i < count; i++, q++) {
> >             q->rx_stats_idx = 0;
> >             q->tx_stats_idx = 0;
> >     }
> 
> ...

-- 
Regards,
listout

Reply via email to