hash: fix __rte_hash_lookup_bulk return value

Message ID 20181208000126.44046-1-jeffrey.b.shaw@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series hash: fix __rte_hash_lookup_bulk return value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Jeff Shaw Dec. 8, 2018, 12:01 a.m. UTC
  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")

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
---
 lib/librte_hash/rte_cuckoo_hash.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Bruce Richardson Dec. 10, 2018, 10:29 a.m. UTC | #1
On Fri, Dec 07, 2018 at 04:01:26PM -0800, Jeff Shaw wrote:
> 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")
> 
> Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon Dec. 21, 2018, 12:43 a.m. UTC | #2
10/12/2018 11:29, Bruce Richardson:
> On Fri, Dec 07, 2018 at 04:01:26PM -0800, Jeff Shaw wrote:
> > 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")
> > 
> > Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index c55a4f263..7e6c139d3 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -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