[PATCH v2 06/23] examples/vmdq: resolve shadow variable warning
Stephen Hemminger
stephen at networkplumber.org
Tue Apr 7 17:16:02 CEST 2026
Rename parameter of get_eth_conf to avoid conflicting
with global variable.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
examples/vmdq/main.c | 8 ++++----
examples/vmdq/meson.build | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 12ef5bffc2..8c9d885090 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -135,19 +135,19 @@ static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
/* Building correct configuration for vdmq. 8< */
static inline int
-get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
+get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t max_pools)
{
struct rte_eth_vmdq_rx_conf conf;
unsigned i;
- conf.nb_queue_pools = (enum rte_eth_nb_pools)num_pools;
- conf.nb_pool_maps = num_pools;
+ conf.nb_queue_pools = (enum rte_eth_nb_pools)max_pools;
+ conf.nb_pool_maps = max_pools;
conf.enable_default_pool = 0;
conf.default_pool = 0; /* set explicit value, even if not used */
for (i = 0; i < conf.nb_pool_maps; i++) {
conf.pool_map[i].vlan_id = vlan_tags[i];
- conf.pool_map[i].pools = (1UL << (i % num_pools));
+ conf.pool_map[i].pools = (1UL << (i % max_pools));
}
*eth_conf = vmdq_conf_default;
diff --git a/examples/vmdq/meson.build b/examples/vmdq/meson.build
index 6fcde9815c..441678bbe5 100644
--- a/examples/vmdq/meson.build
+++ b/examples/vmdq/meson.build
@@ -10,4 +10,3 @@ allow_experimental_apis = true
sources = files(
'main.c',
)
-cflags += no_shadow_cflag
--
2.53.0
More information about the dev
mailing list