From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Bruce Richardson <bruce.richardson@intel.com>,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH v2 16/23] examples/qos_sched: eliminate shadowed variables
Date: Tue, 7 Apr 2026 08:16:12 -0700 [thread overview]
Message-ID: <20260407151732.272195-17-stephen@networkplumber.org> (raw)
In-Reply-To: <20260407151732.272195-1-stephen@networkplumber.org>
The port_params and subport_params are global variables,
then passed to load functions. The names clash so just use
the globals.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
examples/qos_sched/cfg_file.c | 12 ++++++------
examples/qos_sched/cfg_file.h | 4 ++--
examples/qos_sched/init.c | 4 ++--
examples/qos_sched/meson.build | 1 -
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c
index c75cf9db2e..3ca06c2ff9 100644
--- a/examples/qos_sched/cfg_file.c
+++ b/examples/qos_sched/cfg_file.c
@@ -41,20 +41,20 @@ int parse_u64(const char *entry, uint64_t *val)
}
int
-cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params)
+cfg_load_port(struct rte_cfgfile *cfg)
{
const char *entry;
- if (!cfg || !port_params)
+ if (!cfg)
return -1;
entry = rte_cfgfile_get_entry(cfg, "port", "frame overhead");
if (entry)
- port_params->frame_overhead = (uint32_t)atoi(entry);
+ port_params.frame_overhead = (uint32_t)atoi(entry);
entry = rte_cfgfile_get_entry(cfg, "port", "number of subports per port");
if (entry)
- port_params->n_subports_per_port = (uint32_t)atoi(entry);
+ port_params.n_subports_per_port = (uint32_t)atoi(entry);
return 0;
}
@@ -279,13 +279,13 @@ cfg_load_subport_profile(struct rte_cfgfile *cfg,
}
int
-cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)
+cfg_load_subport(struct rte_cfgfile *cfg)
{
bool cman_enabled = false;
const char *entry;
int i, j, k;
- if (!cfg || !subport_params)
+ if (!cfg)
return -1;
memset(app_pipe_to_profile, -1, sizeof(app_pipe_to_profile));
diff --git a/examples/qos_sched/cfg_file.h b/examples/qos_sched/cfg_file.h
index 71d280718f..26552f1e30 100644
--- a/examples/qos_sched/cfg_file.h
+++ b/examples/qos_sched/cfg_file.h
@@ -10,11 +10,11 @@
int parse_u64(const char *entry, uint64_t *val);
-int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
+int cfg_load_port(struct rte_cfgfile *cfg);
int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
-int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
+int cfg_load_subport(struct rte_cfgfile *cfg);
int cfg_load_subport_profile(struct rte_cfgfile *cfg,
struct rte_sched_subport_profile_params
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index ace7279c67..561f9e0619 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -296,11 +296,11 @@ app_load_cfg_profile(const char *profile)
if (file == NULL)
rte_exit(EXIT_FAILURE, "Cannot load configuration profile %s\n", profile);
- ret = cfg_load_port(file, &port_params);
+ ret = cfg_load_port(file);
if (ret)
goto _app_load_cfg_profile_error_return;
- ret = cfg_load_subport(file, subport_params);
+ ret = cfg_load_subport(file);
if (ret)
goto _app_load_cfg_profile_error_return;
diff --git a/examples/qos_sched/meson.build b/examples/qos_sched/meson.build
index 4657c756a1..92657ce8a5 100644
--- a/examples/qos_sched/meson.build
+++ b/examples/qos_sched/meson.build
@@ -18,4 +18,3 @@ sources = files(
'stats.c',
)
cflags += no_wvla_cflag
-cflags += no_shadow_cflag
--
2.53.0
next prev parent reply other threads:[~2026-04-07 15:19 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 3:49 [PATCH 00/23] examples: enable -Wshadow across all examples Stephen Hemminger
2026-04-07 3:49 ` [PATCH 01/23] examples/ethtool: fix shadow variable warning Stephen Hemminger
2026-04-07 3:49 ` [PATCH 02/23] examples/eventdev_pipeline: " Stephen Hemminger
2026-04-07 3:49 ` [PATCH 03/23] examples/dma: fix shadow variable warnings Stephen Hemminger
2026-04-07 3:49 ` [PATCH 04/23] examples/packet_ordering: fix shadow variable warning Stephen Hemminger
2026-04-07 3:49 ` [PATCH 05/23] examples/bond: fix shadow variable warnings Stephen Hemminger
2026-04-07 3:49 ` [PATCH 06/23] examples/vmdq: fix shadow variable warning Stephen Hemminger
2026-04-07 3:49 ` [PATCH 07/23] examples/server_node_efd: fix shadowed variable Stephen Hemminger
2026-04-07 3:49 ` [PATCH 08/23] examples/flow_filtering: fix shadowed variables Stephen Hemminger
2026-04-07 3:49 ` [PATCH 09/23] examples/ipsec-secgw: " Stephen Hemminger
2026-04-07 3:49 ` [PATCH 10/23] examples/ip_pipeline: fix shadow variable Stephen Hemminger
2026-04-07 3:49 ` [PATCH 11/23] examples/multi_process: fix shadowed variable Stephen Hemminger
2026-04-07 3:49 ` [PATCH 12/23] examples/vm_power_manage: enable shadow warnings Stephen Hemminger
2026-04-07 3:49 ` [PATCH 13/23] examples/bbdev_app: " Stephen Hemminger
2026-04-07 3:49 ` [PATCH 14/23] examples/ptpclient: fix shadow variable warnings Stephen Hemminger
2026-04-07 3:49 ` [PATCH 15/23] examples/vhost: fix shadow warnings Stephen Hemminger
2026-04-07 3:49 ` [PATCH 16/23] examples/qos_sched: eliminate shadowed variables Stephen Hemminger
2026-04-07 3:49 ` [PATCH 17/23] examples/l2fwd-jobstats: fix shadowed variable Stephen Hemminger
2026-04-07 3:49 ` [PATCH 18/23] examples/l2fwd-crypto: remove no shadow flag Stephen Hemminger
2026-04-07 3:49 ` [PATCH 19/23] examples/l2fwd-event: " Stephen Hemminger
2026-04-07 3:49 ` [PATCH 20/23] examples/l2fwd-keepalive: fix shadow variable warning Stephen Hemminger
2026-04-07 3:49 ` [PATCH 21/23] examples/l3fwd-graph: remove no shadow flag Stephen Hemminger
2026-04-07 3:49 ` [PATCH 22/23] examples/l3fwd: fix shadow variable warnings Stephen Hemminger
2026-04-07 3:49 ` [PATCH 23/23] examples/l3fwd-power: " Stephen Hemminger
2026-04-07 9:22 ` [PATCH 00/23] examples: enable -Wshadow across all examples Bruce Richardson
2026-04-07 15:15 ` [PATCH v2 00/23] examples: fix -Wshadow warnings Stephen Hemminger
2026-04-07 15:15 ` [PATCH v2 01/23] examples/ethtool: resolve shadow variable warnings Stephen Hemminger
2026-04-08 0:32 ` fengchengwen
2026-04-07 15:15 ` [PATCH v2 02/23] examples/eventdev_pipeline: resolve shadow variable warning Stephen Hemminger
2026-04-07 15:15 ` [PATCH v2 03/23] examples/dma: resolve shadow variable warnings Stephen Hemminger
2026-04-08 0:30 ` fengchengwen
2026-04-07 15:16 ` [PATCH v2 04/23] examples/packet_ordering: resolve shadow variable warning Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 05/23] examples/bond: resolve shadow variable warnings Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 06/23] examples/vmdq: resolve shadow variable warning Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 07/23] examples/server_node_efd: " Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 08/23] examples/flow_filtering: resolve shadowed variable warnings Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 09/23] examples/ipsec-secgw: " Stephen Hemminger
2026-04-13 15:16 ` Radu Nicolau
2026-06-18 9:20 ` Thomas Monjalon
2026-04-07 15:16 ` [PATCH v2 10/23] examples/ip_pipeline: resolve shadow variable warning Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 11/23] examples/multi_process: resolve shadowed variable warnings Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 12/23] examples/vm_power_manage: enable shadow warnings Stephen Hemminger
2026-06-18 9:12 ` Thomas Monjalon
2026-04-07 15:16 ` [PATCH v2 13/23] examples/bbdev_app: " Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 14/23] examples/ptpclient: resolve shadow variable warnings Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 15/23] examples/vhost: resolve shadow warnings Stephen Hemminger
2026-04-07 15:16 ` Stephen Hemminger [this message]
2026-04-07 15:16 ` [PATCH v2 17/23] examples/l2fwd-jobstats: resolve shadowed variable Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 18/23] examples/l2fwd-crypto: resolve shadow variable Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 19/23] examples/l2fwd-event: resolve shadowed variable Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 20/23] examples/l2fwd-keepalive: resolve shadow variable warning Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 21/23] examples/l3fwd-graph: " Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 22/23] examples/l3fwd: resolve shadow variable warnings Stephen Hemminger
2026-04-07 15:16 ` [PATCH v2 23/23] examples/l3fwd-power: " Stephen Hemminger
2026-06-18 13:09 ` [PATCH v2 00/23] examples: fix -Wshadow warnings Thomas Monjalon
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=20260407151732.272195-17-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.