Skip to contentSkip to conversation

ethdev: fix shadow variable definition

PATCH In review Stephen Hemminger 1 participant 2 messages Jul 3, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: fix shadow variable definition

The variable 'ret' is defined twice in rte_eth_tx_queue_setup. Can remove one.

Fixes 1bb4a528c41f ("ethdev: fix max Rx packet length")
---
 config/meson.build      | 1 +
 lib/ethdev/rte_ethdev.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
config/meson.build +1 -0
index f31fef216c..3fc58c53b8 100644
@@ -322,6 +322,7 @@ global_cflags = [
         '-Wnested-externs',
         '-Wold-style-definition',
         '-Wpointer-arith',
+        '-Wshadow',
         '-Wsign-compare',
         '-Wstrict-prototypes',
         '-Wundef',
lib/ethdev/rte_ethdev.c +0 -1
index dd7c00bc94..9934e48415 100644
@@ -2468,7 +2468,6 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 	if (local_conf.offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO) {
 		uint32_t overhead_len;
 		uint32_t max_rx_pktlen;
-		int ret;
 
 		overhead_len = eth_dev_get_overhead_len(dev_info.max_rx_pktlen,
 				dev_info.max_mtu);
Signature · 1 line
2.47.2
#1 lore raw

config/meson.build global_cflags = [ · line 328

Quoted 12 lines · On Thu, 3 Jul 2025 10:24:07 -0700 Stephen Hemminger…
config/meson.build +1 -0
index f31fef216c..3fc58c53b8 100644
@@ -322,6 +322,7 @@ global_cflags = [
         '-Wnested-externs',
         '-Wold-style-definition',
         '-Wpointer-arith',
+        '-Wshadow',
         '-Wsign-compare',
         '-Wstrict-prototypes',
         '-Wundef',

OOPS didn't mean for that bit, it triggers lots of warnings. See other bugs