[PATCH v2 08/23] examples/flow_filtering: resolve shadowed variable warnings
Stephen Hemminger
stephen at networkplumber.org
Tue Apr 7 17:16:04 CEST 2026
Rename places where argument name is shadowing a global variable.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
examples/flow_filtering/flow_skeleton.c | 10 +++++-----
examples/flow_filtering/main.c | 4 ++--
examples/flow_filtering/meson.build | 1 -
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/examples/flow_filtering/flow_skeleton.c b/examples/flow_filtering/flow_skeleton.c
index 7e57b13b55..bc1d07fbe3 100644
--- a/examples/flow_filtering/flow_skeleton.c
+++ b/examples/flow_filtering/flow_skeleton.c
@@ -14,7 +14,7 @@ struct rte_flow_attr flow_attr;
struct rte_flow_op_attr ops_attr = { .postpone = 0 };
static struct rte_flow *
-create_flow_non_template(uint16_t port_id, struct rte_flow_attr *flow_attr,
+create_flow_non_template(uint16_t port_id, struct rte_flow_attr *attr,
struct rte_flow_item *patterns,
struct rte_flow_action *actions,
struct rte_flow_error *error)
@@ -22,13 +22,13 @@ create_flow_non_template(uint16_t port_id, struct rte_flow_attr *flow_attr,
struct rte_flow *flow = NULL;
/* Validate the rule and create it. */
- if (rte_flow_validate(port_id, flow_attr, patterns, actions, error) == 0)
- flow = rte_flow_create(port_id, flow_attr, patterns, actions, error);
+ if (rte_flow_validate(port_id, attr, patterns, actions, error) == 0)
+ flow = rte_flow_create(port_id, attr, patterns, actions, error);
return flow;
}
static struct rte_flow *
-create_flow_template(uint16_t port_id, struct rte_flow_op_attr *ops_attr,
+create_flow_template(uint16_t port_id, struct rte_flow_op_attr *attr,
struct rte_flow_item *patterns,
struct rte_flow_action *actions,
struct rte_flow_error *error)
@@ -42,7 +42,7 @@ create_flow_template(uint16_t port_id, struct rte_flow_op_attr *ops_attr,
return rte_flow_async_create(port_id,
1, /* Flow queue used to insert the rule. */
- ops_attr,
+ attr,
table,
patterns,
0, /* Pattern template index in the table. */
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index 8ea6596ed4..f2124881a0 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -125,7 +125,7 @@ assert_link_status(void)
}
static void
-configure_port_template(uint16_t port_id)
+configure_port_template(void)
{
int ret;
uint16_t std_queue;
@@ -254,7 +254,7 @@ init_port(void)
"rte_eth_dev_stop:err=%d, port=%u\n",
ret, port_id);
- configure_port_template(port_id);
+ configure_port_template();
ret = rte_eth_dev_start(port_id);
if (ret < 0)
rte_exit(EXIT_FAILURE,
diff --git a/examples/flow_filtering/meson.build b/examples/flow_filtering/meson.build
index e2d5850a19..e82d63ad8b 100644
--- a/examples/flow_filtering/meson.build
+++ b/examples/flow_filtering/meson.build
@@ -33,4 +33,3 @@ sources = files(
# The code snippets are not utilized.
cflags += '-Wno-unused-function'
-cflags += no_shadow_cflag
--
2.53.0
More information about the dev
mailing list