DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] hash: fix maybe-uninitialized warning on minsize build
@ 2026-11-23  6:13 Cheryl Bansal
  2026-11-23  6:13 ` [PATCH 2/2] bus/pci: add selective BAR mapping support Cheryl Bansal
  0 siblings, 1 reply; 4+ messages in thread
From: Cheryl Bansal @ 2026-11-23  6:13 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel, Bruce Richardson, Vladimir Medvedkin,
	Chenbo Xia, Nipun Gupta
  Cc: dev, stable, Cheryl Bansal

With --buildtype=minsize and -Werror, gcc reports that slot_id may be
used uninitialized in alloc_slot(). This is a false positive: every
path either returns EMPTY_SLOT or assigns slot_id before use.

Initialize slot_id to EMPTY_SLOT to silence the warning.

Fixes: 5915699153d7 ("hash: fix scaling by reducing contention")
Cc: stable@dpdk.org

Signed-off-by: Cheryl Bansal <cheryl.bansal@altera.com>
---
 .mailmap                   | 1 +
 lib/hash/rte_cuckoo_hash.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index a0096fb97a..5146a4fa2b 100644
--- a/.mailmap
+++ b/.mailmap
@@ -288,6 +288,7 @@ Chenna Arnoori <chenna.arnoori@broadcom.com>
 Chenxingyu Wang <wangchenxingyu@huawei.com>
 Chenxu Di <chenxux.di@intel.com>
 Chenyu Huang <chenyux.huang@intel.com>
+Cheryl Bansal <cheryl.bansal@altera.com>
 Cheryl Houser <chouser@vmware.com>
 Chinh Cao <chinh.t.cao@intel.com>
 Chintu Hetam <rometoroam@gmail.com>
diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 5d495ae973..47ea909d38 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -1298,7 +1298,7 @@ static inline uint32_t
 alloc_slot(const struct rte_hash *h, struct lcore_cache *cached_free_slots)
 {
 	unsigned int n_slots;
-	uint32_t slot_id;
+	uint32_t slot_id = EMPTY_SLOT;
 
 	if (h->use_local_cache) {
 		/* Try to get a free slot from the local cache */
-- 
2.43.0


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

end of thread, other threads:[~2026-11-23 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23  6:13 [PATCH 1/2] hash: fix maybe-uninitialized warning on minsize build Cheryl Bansal
2026-11-23  6:13 ` [PATCH 2/2] bus/pci: add selective BAR mapping support Cheryl Bansal
2026-11-23  7:57   ` David Marchand
2026-11-23 17:03     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox