[RFC PATCH 08/19] power: rename variable to eliminate shadowing

Bruce Richardson
2025-11-06T14:10:54Z

The "pause_duration" variable is a global and then shadowed as a local
var in clb_pause. Rename the local variable to allow building with
"-Wshadow".

Fixes: 4a8fbc28e431 ("power: add get/set pause duration API")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/power/rte_power_pmd_mgmt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c
index 6cacc562c2..a4d53aac2a 100644
--- a/lib/power/rte_power_pmd_mgmt.c
+++ b/lib/power/rte_power_pmd_mgmt.c
@@ -337,7 +337,7 @@ clb_pause(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused,
struct queue_list_entry *queue_conf = arg;
struct pmd_core_cfg *lcore_conf;
const bool empty = nb_rx == 0;
- uint32_t pause_duration = rte_power_pmd_mgmt_get_pause_duration();
+ const uint32_t duration = rte_power_pmd_mgmt_get_pause_duration();

lcore_conf = RTE_LCORE_VAR(lcore_cfgs);

@@ -357,11 +357,11 @@ clb_pause(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused,
if (global_data.intrinsics_support.power_pause) {
const uint64_t cur = rte_rdtsc();
const uint64_t wait_tsc =
- cur + global_data.tsc_per_us * pause_duration;
+ cur + global_data.tsc_per_us * duration;
rte_power_pause(wait_tsc);
} else {
uint64_t i;
- for (i = 0; i < global_data.pause_per_us * pause_duration; i++)
+ for (i = 0; i < global_data.pause_per_us * duration; i++)
rte_pause();
}
}
--
2.48.1