From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org
Cc: ktraynor@redhat.com, alialnu@nvidia.com
Subject: [PATCH 21.11] net/softnic: fix maybe-uninitialized warning
Date: Wed, 11 Sep 2024 15:12:59 +0100 [thread overview]
Message-ID: <20240911141259.55514-1-ktraynor@redhat.com> (raw)
In pmd_mtr_stats_read() 'struct rte_mtr_stats s' is initialized
during the call to mtr_stats_convert() but on some systems it
is triggering a compiler warning. e.g.
drivers/net/softnic/rte_eth_softnic_meter.c:916:25: error: 's'
may be used uninitialized [-Werror=maybe-uninitialized]
Initialize the struct in pmd_mtr_stats_read() to avoid warnings.
Reported-by: Ali Alnubani <alialnu@nvidia.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/net/softnic/rte_eth_softnic_meter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c
index 6b02f43e31..fea26f9c14 100644
--- a/drivers/net/softnic/rte_eth_softnic_meter.c
+++ b/drivers/net/softnic/rte_eth_softnic_meter.c
@@ -904,5 +904,5 @@ pmd_mtr_stats_read(struct rte_eth_dev *dev,
/* Stats format conversion. */
if (stats || stats_mask) {
- struct rte_mtr_stats s;
+ struct rte_mtr_stats s = {0};
uint64_t s_mask = 0;
--
2.46.0
next reply other threads:[~2024-09-11 14:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 14:12 Kevin Traynor [this message]
2024-09-13 9:05 ` Kevin Traynor
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=20240911141259.55514-1-ktraynor@redhat.com \
--to=ktraynor@redhat.com \
--cc=alialnu@nvidia.com \
--cc=stable@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 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).