Skip to contentSkip to conversation

hash: fix __rte_hash_lookup_bulk return value

PATCH Applied Jeff Shaw 3 participants 3 messages Dec 8, 2018 – Dec 21, 2018

lore
Share & tools
lore

Jeff Shaw

author
#0 lore raw

PATCH 1/1 hash: fix __rte_hash_lookup_bulk return value

The __rte_hash_lookup_bulk() function returns void, and therefore should not return with an expression. This commit fixes the following compiler warning when attempting to compile with "-pedantic -std=c11".

warning: ISO C forbids ‘return’ with expression, in function
returning void [-Wpedantic]

Fixes 9eca8bd7a61c ("hash: separate lock-free and r/w lock lookup")
---
 lib/librte_hash/rte_cuckoo_hash.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/librte_hash/rte_cuckoo_hash.c +4 -4
index c55a4f263..7e6c139d3 100644
@@ -2022,11 +2022,11 @@ __rte_hash_lookup_bulk(const struct rte_hash *h, const void **keys,
 			uint64_t *hit_mask, void *data[])
 {
 	if (h->readwrite_concur_lf_support)
-		return __rte_hash_lookup_bulk_lf(h, keys, num_keys,
-						positions, hit_mask, data);
+		__rte_hash_lookup_bulk_lf(h, keys, num_keys, positions,
+					  hit_mask, data);
 	else
-		return __rte_hash_lookup_bulk_l(h, keys, num_keys,
-						positions, hit_mask, data);
+		__rte_hash_lookup_bulk_l(h, keys, num_keys, positions,
+					 hit_mask, data);
 }
 
 int
Signature · 1 line
2.14.3
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jeff Shaw

The __rte_hash_lookup_bulk() function returns void, and therefore should not return with an expression. This commit fixes the following compiler warning when attempting to compile with "-pedantic -std=c11".

warning: ISO C forbids ‘return’ with expression, in function
returning void [-Wpedantic]

Fixes 9eca8bd7a61c ("hash: separate lock-free and r/w lock lookup")

---

#2 lore raw

10/12/2018 11:29, Bruce Richardson:

Quoted 5 lines · Jeff Shaw
Quoted 4 lines

The __rte_hash_lookup_bulk() function returns void, and therefore should not return with an expression. This commit fixes the following compiler warning when attempting to compile with "-pedantic -std=c11".

Quoted 8 lines
Quoted 7 lines

warning: ISO C forbids ‘return’ with expression, in function
returning void [-Wpedantic]

Fixes 9eca8bd7a61c ("hash: separate lock-free and r/w lock lookup")

---

Applied, thanks