[PATCH v4 15/31] net/ice: fix build with shadow warnings enabled

Bruce Richardson
2026-01-14T15:46:50Z

The RTE_MIN macro used newly-defined local variables internally, which
means that it had variable shadowing issues when one RTE_MIN call was
used inside another. Fix this for ice driver by using two separate
RTE_MIN calls to have the same effect.

Fixes: 8c03aa5e00f0 ("net/ice: optimize maximum queue number calculation")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/intel/ice/ice_ethdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index c721d135f5..3242572cd8 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -999,9 +999,9 @@ ice_vsi_config_tc_queue_mapping(struct ice_hw *hw, struct ice_vsi *vsi,
if (vsi->adapter->hw.func_caps.common_cap.num_msix_vectors < 2) {
vsi->nb_qps = 0;
} else {
- vsi->nb_qps = RTE_MIN
- ((uint16_t)vsi->adapter->hw.func_caps.common_cap.num_msix_vectors - 2,
- RTE_MIN(vsi->nb_qps, ICE_MAX_Q_PER_TC));
+ vsi->nb_qps = RTE_MIN(vsi->nb_qps, ICE_MAX_Q_PER_TC);
+ vsi->nb_qps = RTE_MIN(vsi->nb_qps,
+ (uint16_t)vsi->adapter->hw.func_caps.common_cap.num_msix_vectors - 2);

/* cap max QPs to what the HW reports as num-children for each layer.
* Multiply num_children for each layer from the entry_point layer to
--
2.51.0