[PATCH v4 03/31] ethdev: fix variable shadowing issues

Bruce Richardson
2026-01-14T15:45:22Z

Remove unneeded extra variable definitions, and rename variables as
necessary to ensure clean compile with -Wshadow warnings enabled.

Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs")
Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ethdev/ethdev_driver.c | 6 +++---
lib/ethdev/rte_ethdev.c | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c
index f89562b237..2ec665be0f 100644
--- a/lib/ethdev/ethdev_driver.c
+++ b/lib/ethdev/ethdev_driver.c
@@ -310,7 +310,7 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_dev_create)
int
rte_eth_dev_create(struct rte_device *device, const char *name,
size_t priv_data_size,
- ethdev_bus_specific_init ethdev_bus_specific_init,
+ ethdev_bus_specific_init bus_specific_init,
void *bus_init_params,
ethdev_init_t ethdev_init, void *init_params)
{
@@ -358,8 +358,8 @@ rte_eth_dev_create(struct rte_device *device, const char *name,

ethdev->device = device;

- if (ethdev_bus_specific_init) {
- retval = ethdev_bus_specific_init(ethdev, bus_init_params);
+ if (bus_specific_init) {
+ retval = bus_specific_init(ethdev, bus_init_params);
if (retval) {
RTE_ETHDEV_LOG_LINE(ERR,
"ethdev bus specific initialisation failed");
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index c6fe0d5165..2659e8d9eb 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -2471,7 +2471,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);
--
2.51.0