patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 21.11] net/softnic: fix maybe-uninitialized warning
@ 2024-09-11 14:12 Kevin Traynor
  2024-09-13  9:05 ` Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Traynor @ 2024-09-11 14:12 UTC (permalink / raw)
  To: stable; +Cc: ktraynor, alialnu

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-13  9:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-11 14:12 [PATCH 21.11] net/softnic: fix maybe-uninitialized warning Kevin Traynor
2024-09-13  9:05 ` Kevin Traynor

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).