netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: intel: fm10k: Fix parameter idx set but not used
@ 2025-09-01 21:31 Brahmajit Das
  2025-09-01 22:13 ` Vadim Fedorenko
  2025-09-03  6:09 ` [Intel-wired-lan] [PATCH] " Loktionov, Aleksandr
  0 siblings, 2 replies; 10+ messages in thread
From: Brahmajit Das @ 2025-09-01 21:31 UTC (permalink / raw)
  To: netdev, intel-wired-lan
  Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem, kuba,
	listout

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 dead code and fixes the build error.

Signed-off-by: Brahmajit Das <listout@listout.xyz>
---
 drivers/net/ethernet/intel/fm10k/fm10k_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
index f51a63fca513..2fcbbd5accc2 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
@@ -457,7 +457,7 @@ void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, 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;
 	}
-- 
2.51.0


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

* Re: [PATCH] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-01 21:31 [PATCH] net: intel: fm10k: Fix parameter idx set but not used Brahmajit Das
@ 2025-09-01 22:13 ` Vadim Fedorenko
  2025-09-02  7:24   ` [PATCH v2] " Brahmajit Das
  2025-09-03  6:09 ` [Intel-wired-lan] [PATCH] " Loktionov, Aleksandr
  1 sibling, 1 reply; 10+ messages in thread
From: Vadim Fedorenko @ 2025-09-01 22:13 UTC (permalink / raw)
  To: Brahmajit Das, netdev, intel-wired-lan
  Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem, kuba

On 01/09/2025 22:31, Brahmajit Das wrote:
> 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 dead code and fixes the build error.
> 
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
>   drivers/net/ethernet/intel/fm10k/fm10k_common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> index f51a63fca513..2fcbbd5accc2 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> @@ -457,7 +457,7 @@ void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, 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;
>   	}

All callers to this function provide constant 0 as idx param. The better
solution would be to remove the parameter completely.

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

* [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-01 22:13 ` Vadim Fedorenko
@ 2025-09-02  7:24   ` Brahmajit Das
  2025-09-02  7:41     ` Vadim Fedorenko
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Brahmajit Das @ 2025-09-02  7:24 UTC (permalink / raw)
  To: vadim.fedorenko
  Cc: andrew+netdev, anthony.l.nguyen, davem, intel-wired-lan, kuba,
	listout, netdev, przemyslaw.kitszel

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 <vadim.fedorenko@linux.dev>
Signed-off-by: Brahmajit Das <listout@listout.xyz>
---
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.
  **/
-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;
 	}
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.h b/drivers/net/ethernet/intel/fm10k/fm10k_common.h
index 4c48fb73b3e7..13fca6a91a01 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_common.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.h
@@ -43,6 +43,6 @@ u32 fm10k_read_hw_stats_32b(struct fm10k_hw *hw, u32 addr,
 void fm10k_update_hw_stats_q(struct fm10k_hw *hw, struct fm10k_hw_stats_q *q,
 			     u32 idx, u32 count);
 #define fm10k_unbind_hw_stats_32b(s) ((s)->base_h = 0)
-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);
 s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready);
 #endif /* _FM10K_COMMON_H_ */
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
index b9dd7b719832..3394645a18fe 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
@@ -1389,7 +1389,7 @@ static void fm10k_rebind_hw_stats_pf(struct fm10k_hw *hw,
 	fm10k_unbind_hw_stats_32b(&stats->nodesc_drop);
 
 	/* Unbind Queue Statistics */
-	fm10k_unbind_hw_stats_q(stats->q, 0, hw->mac.max_queues);
+	fm10k_unbind_hw_stats_q(stats->q, hw->mac.max_queues);
 
 	/* Reinitialize bases for all stats */
 	fm10k_update_hw_stats_pf(hw, stats);
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_vf.c b/drivers/net/ethernet/intel/fm10k/fm10k_vf.c
index 7fb1961f2921..6861a0bdc14e 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_vf.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_vf.c
@@ -465,7 +465,7 @@ static void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw,
 				     struct fm10k_hw_stats *stats)
 {
 	/* Unbind Queue Statistics */
-	fm10k_unbind_hw_stats_q(stats->q, 0, hw->mac.max_queues);
+	fm10k_unbind_hw_stats_q(stats->q, hw->mac.max_queues);
 
 	/* Reinitialize bases for all stats */
 	fm10k_update_hw_stats_vf(hw, stats);
-- 
2.51.0


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

* Re: [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-02  7:24   ` [PATCH v2] " Brahmajit Das
@ 2025-09-02  7:41     ` Vadim Fedorenko
  2025-09-02 10:34     ` Vadim Fedorenko
  2025-09-03  6:08     ` [Intel-wired-lan] " Loktionov, Aleksandr
  2 siblings, 0 replies; 10+ messages in thread
From: Vadim Fedorenko @ 2025-09-02  7:41 UTC (permalink / raw)
  To: Brahmajit Das
  Cc: andrew+netdev, anthony.l.nguyen, davem, intel-wired-lan, kuba,
	netdev, przemyslaw.kitszel

On 02/09/2025 08:24, Brahmajit Das wrote:
> 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 <vadim.fedorenko@linux.dev>
> Signed-off-by: Brahmajit Das <listout@listout.xyz>

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

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

* Re: [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-02  7:24   ` [PATCH v2] " Brahmajit Das
  2025-09-02  7:41     ` Vadim Fedorenko
@ 2025-09-02 10:34     ` Vadim Fedorenko
  2025-09-02 10:47       ` Brahmajit Das
  2025-09-03  6:08     ` [Intel-wired-lan] " Loktionov, Aleksandr
  2 siblings, 1 reply; 10+ messages in thread
From: Vadim Fedorenko @ 2025-09-02 10:34 UTC (permalink / raw)
  To: Brahmajit Das
  Cc: andrew+netdev, anthony.l.nguyen, davem, intel-wired-lan, kuba,
	netdev, przemyslaw.kitszel

On 02/09/2025 08:24, Brahmajit Das wrote:
> 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 <vadim.fedorenko@linux.dev>
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
> changes in v2:
> 	- Removed the idx parameter, since all callers of
> 	fm10k_unbind_hw_stats_q passes idx as 0 anyways.
Just a reminder that you shouldn't send another version of the patch
as a reply to the previous version. And you have to wait for at least
24h before sending next version to let other reviewers look at the code.
Current submission looks OK in patchwork, so no action is needed from
you right now.

Thanks,
Vadim

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

* Re: [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-02 10:34     ` Vadim Fedorenko
@ 2025-09-02 10:47       ` Brahmajit Das
  0 siblings, 0 replies; 10+ messages in thread
From: Brahmajit Das @ 2025-09-02 10:47 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: andrew+netdev, anthony.l.nguyen, davem, intel-wired-lan, kuba,
	netdev, przemyslaw.kitszel

On 02.09.2025 11:34, Vadim Fedorenko wrote:
> On 02/09/2025 08:24, Brahmajit Das wrote:
> > 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 <vadim.fedorenko@linux.dev>
> > Signed-off-by: Brahmajit Das <listout@listout.xyz>
> > ---
> > changes in v2:
> > 	- Removed the idx parameter, since all callers of
> > 	fm10k_unbind_hw_stats_q passes idx as 0 anyways.
> Just a reminder that you shouldn't send another version of the patch
> as a reply to the previous version. And you have to wait for at least
> 24h before sending next version to let other reviewers look at the code.
> Current submission looks OK in patchwork, so no action is needed from
> you right now.
> 
> Thanks,
> Vadim

Noted, thank you.
-- 
Regards,
listout

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

* RE: [Intel-wired-lan] [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-02  7:24   ` [PATCH v2] " Brahmajit Das
  2025-09-02  7:41     ` Vadim Fedorenko
  2025-09-02 10:34     ` Vadim Fedorenko
@ 2025-09-03  6:08     ` Loktionov, Aleksandr
  2025-09-03  9:11       ` Brahmajit Das
  2 siblings, 1 reply; 10+ messages in thread
From: Loktionov, Aleksandr @ 2025-09-03  6:08 UTC (permalink / raw)
  To: Brahmajit Das, vadim.fedorenko@linux.dev
  Cc: andrew+netdev@lunn.ch, Nguyen, Anthony L, davem@davemloft.net,
	intel-wired-lan@lists.osuosl.org, kuba@kernel.org,
	netdev@vger.kernel.org, Kitszel, Przemyslaw



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Brahmajit Das
> Sent: Tuesday, September 2, 2025 9:24 AM
> To: vadim.fedorenko@linux.dev
> Cc: andrew+netdev@lunn.ch; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; davem@davemloft.net; intel-wired-
> lan@lists.osuosl.org; kuba@kernel.org; listout@listout.xyz;
> netdev@vger.kernel.org; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>
> 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 <vadim.fedorenko@linux.dev>
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
> 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 <aleksandr.loktionov@intel.com>


> -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;
>  	}

...

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

* RE: [Intel-wired-lan] [PATCH] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-01 21:31 [PATCH] net: intel: fm10k: Fix parameter idx set but not used Brahmajit Das
  2025-09-01 22:13 ` Vadim Fedorenko
@ 2025-09-03  6:09 ` Loktionov, Aleksandr
  1 sibling, 0 replies; 10+ messages in thread
From: Loktionov, Aleksandr @ 2025-09-03  6:09 UTC (permalink / raw)
  To: Brahmajit Das, netdev@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, andrew+netdev@lunn.ch,
	davem@davemloft.net, kuba@kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Brahmajit Das
> Sent: Monday, September 1, 2025 11:31 PM
> To: netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; andrew+netdev@lunn.ch;
> davem@davemloft.net; kuba@kernel.org; listout@listout.xyz
> Subject: [Intel-wired-lan] [PATCH] 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 dead code and fixes the build error.
> 
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> index f51a63fca513..2fcbbd5accc2 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c
> @@ -457,7 +457,7 @@ void fm10k_unbind_hw_stats_q(struct
> fm10k_hw_stats_q *q, u32 idx, u32 count)
It looks for me that idx++ was removed, but idx is still passed as a parameter and unused, am I wrong?

>  {
>  	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;
>  	}
> --
> 2.51.0


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

* Re: [Intel-wired-lan] [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-03  6:08     ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-09-03  9:11       ` Brahmajit Das
  2025-09-03  9:15         ` Loktionov, Aleksandr
  0 siblings, 1 reply; 10+ messages in thread
From: Brahmajit Das @ 2025-09-03  9:11 UTC (permalink / raw)
  To: Loktionov, Aleksandr
  Cc: vadim.fedorenko@linux.dev, andrew+netdev@lunn.ch,
	Nguyen, Anthony L, davem@davemloft.net,
	intel-wired-lan@lists.osuosl.org, kuba@kernel.org,
	netdev@vger.kernel.org, Kitszel, Przemyslaw

On 03.09.2025 06:08, Loktionov, Aleksandr wrote:
> 
> 
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > Of Brahmajit Das
> > Sent: Tuesday, September 2, 2025 9:24 AM
> > To: vadim.fedorenko@linux.dev
> > Cc: andrew+netdev@lunn.ch; Nguyen, Anthony L
> > <anthony.l.nguyen@intel.com>; davem@davemloft.net; intel-wired-
> > lan@lists.osuosl.org; kuba@kernel.org; listout@listout.xyz;
> > netdev@vger.kernel.org; Kitszel, Przemyslaw
> > <przemyslaw.kitszel@intel.com>
> > 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 <vadim.fedorenko@linux.dev>
> > Signed-off-by: Brahmajit Das <listout@listout.xyz>
> > ---
> > 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 <aleksandr.loktionov@intel.com>
> 
> 
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

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

* RE: [Intel-wired-lan] [PATCH v2] net: intel: fm10k: Fix parameter idx set but not used
  2025-09-03  9:11       ` Brahmajit Das
@ 2025-09-03  9:15         ` Loktionov, Aleksandr
  0 siblings, 0 replies; 10+ messages in thread
From: Loktionov, Aleksandr @ 2025-09-03  9:15 UTC (permalink / raw)
  To: Brahmajit Das
  Cc: vadim.fedorenko@linux.dev, andrew+netdev@lunn.ch,
	Nguyen, Anthony L, davem@davemloft.net,
	intel-wired-lan@lists.osuosl.org, kuba@kernel.org,
	netdev@vger.kernel.org, Kitszel, Przemyslaw



> -----Original Message-----
> From: Brahmajit Das <listout@listout.xyz>
> Sent: Wednesday, September 3, 2025 11:11 AM
> To: Loktionov, Aleksandr <aleksandr.loktionov@intel.com>
> Cc: vadim.fedorenko@linux.dev; andrew+netdev@lunn.ch; Nguyen, Anthony
> L <anthony.l.nguyen@intel.com>; davem@davemloft.net; intel-wired-
> lan@lists.osuosl.org; kuba@kernel.org; netdev@vger.kernel.org;
> Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>
> Subject: Re: [Intel-wired-lan] [PATCH v2] net: intel: fm10k: Fix
> parameter idx set but not used
> 
> On 03.09.2025 06:08, Loktionov, Aleksandr wrote:
> >
> >
> > > -----Original Message-----
> > > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On
> Behalf
> > > Of Brahmajit Das
> > > Sent: Tuesday, September 2, 2025 9:24 AM
> > > To: vadim.fedorenko@linux.dev
> > > Cc: andrew+netdev@lunn.ch; Nguyen, Anthony L
> > > <anthony.l.nguyen@intel.com>; davem@davemloft.net; intel-wired-
> > > lan@lists.osuosl.org; kuba@kernel.org; listout@listout.xyz;
> > > netdev@vger.kernel.org; Kitszel, Przemyslaw
> > > <przemyslaw.kitszel@intel.com>
> > > 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 <vadim.fedorenko@linux.dev>
> > > Signed-off-by: Brahmajit Das <listout@listout.xyz>
> > > ---
> > > 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 <aleksandr.loktionov@intel.com>
> >
> >
> 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.
> 
Sorry, my mistake, I overlooked '-' !
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>


> 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

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

end of thread, other threads:[~2025-09-03  9:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 21:31 [PATCH] net: intel: fm10k: Fix parameter idx set but not used Brahmajit Das
2025-09-01 22:13 ` Vadim Fedorenko
2025-09-02  7:24   ` [PATCH v2] " Brahmajit Das
2025-09-02  7:41     ` Vadim Fedorenko
2025-09-02 10:34     ` Vadim Fedorenko
2025-09-02 10:47       ` Brahmajit Das
2025-09-03  6:08     ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-09-03  9:11       ` Brahmajit Das
2025-09-03  9:15         ` Loktionov, Aleksandr
2025-09-03  6:09 ` [Intel-wired-lan] [PATCH] " Loktionov, Aleksandr

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).