From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Thomas Monjalon <thomas@monjalon.net>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [RFC 6/8] ethdev: avoid shadowed variable warnings
Date: Wed, 27 Aug 2025 16:14:09 -0700 [thread overview]
Message-ID: <20250827231528.236172-7-stephen@networkplumber.org> (raw)
In-Reply-To: <20250827231528.236172-1-stephen@networkplumber.org>
With shadow warnings enabled there were a couple of cases
to fix. One was simple reuse of 'ret', other was overlap
between type and variable name.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ethdev/ethdev_driver.c | 2 +-
lib/ethdev/ethdev_driver.h | 6 +++---
lib/ethdev/rte_ethdev.c | 1 -
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c
index ec0c1e1176..11ffaa2219 100644
--- a/lib/ethdev/ethdev_driver.c
+++ b/lib/ethdev/ethdev_driver.c
@@ -295,7 +295,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_t ethdev_bus_specific_init,
void *bus_init_params,
ethdev_init_t ethdev_init, void *init_params)
{
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 2b4d2ae9c3..4c2f2e3489 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -1998,8 +1998,8 @@ rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs,
typedef int (*ethdev_init_t)(struct rte_eth_dev *ethdev, void *init_params);
-typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev,
- void *bus_specific_init_params);
+typedef int (*ethdev_bus_specific_init_t)(struct rte_eth_dev *ethdev,
+ void *bus_specific_init_params);
/**
* PMD helper function for the creation of a new ethdev ports.
@@ -2026,7 +2026,7 @@ __rte_internal
int
rte_eth_dev_create(struct rte_device *device, const char *name,
size_t priv_data_size,
- ethdev_bus_specific_init bus_specific_init, void *bus_init_params,
+ ethdev_bus_specific_init_t bus_specific_init, void *bus_init_params,
ethdev_init_t ethdev_init, void *init_params);
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index dd7c00bc94..9934e48415 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -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);
--
2.47.2
next prev parent reply other threads:[~2025-08-27 23:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 23:14 [RFC 0/8] Avoid overlapping declarations Stephen Hemminger
2025-08-27 23:14 ` [RFC 1/8] test/ring: avoid shadow variable usage Stephen Hemminger
2025-08-28 7:42 ` Bruce Richardson
2025-08-27 23:14 ` [RFC 2/8] test/table: replace conflicting variable name Stephen Hemminger
2025-08-27 23:14 ` [RFC 3/8] eal: add macro to disable shadow warnings Stephen Hemminger
2025-08-28 7:43 ` Bruce Richardson
2025-08-27 23:14 ` [RFC 4/8] eal: avoid shadowed variable aligned_end Stephen Hemminger
2025-08-27 23:14 ` [RFC 5/8] eal: avoid shadowed variables in trace code Stephen Hemminger
2025-08-27 23:14 ` Stephen Hemminger [this message]
2025-08-27 23:14 ` [RFC 7/8] telemetry: avoid potential name conflict for handler Stephen Hemminger
2025-08-28 7:45 ` Bruce Richardson
2025-08-27 23:14 ` [RFC 8/8] pcapng: avoid shadow declaration warning Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250827231528.236172-7-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).