]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: intel: fm10k: Fix parameter idx set but not used
authorBrahmajit Das <listout@listout.xyz>
Tue, 2 Sep 2025 07:24:22 +0000 (12:54 +0530)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 19 Sep 2025 15:42:08 +0000 (08:42 -0700)
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: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_common.c
drivers/net/ethernet/intel/fm10k/fm10k_common.h
drivers/net/ethernet/intel/fm10k/fm10k_pf.c
drivers/net/ethernet/intel/fm10k/fm10k_vf.c

index f51a63fca513e92434e83f0c7372cc8fc22ce298..1f919a50c76535e09afb6aeb172b9c5512f32332 100644 (file)
@@ -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;
        }
index 4c48fb73b3e78c94e92e05a5a1691ca32a5241d3..13fca6a91a01bdf53d24d12998ac6cfc5f5d1647 100644 (file)
@@ -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_ */
index b9dd7b71983243ac8214fb66540454633b3aa93c..3394645a18fe8b091a30c1ae96edebd003eaefe4 100644 (file)
@@ -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);
index 7fb1961f2921018b38f00049c73328c6174880b4..6861a0bdc14e1822e35a3d6c6a522dd176249c5e 100644 (file)
@@ -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);