Skip to contentSkip to conversation

hash: remove return statement from function returning void

PATCH Applied Tyler Retzlaff 3 participants 5 messages Mar 8, 2024 – May 16, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hash: remove return statement from function returning void

rte_thash_gfni_bulk and rte_thash_gfni_bulk_stub both return void. Remove superfluous return statement from rte_thash_gfni_bulk.

Fixes 944a03a5cfc1 ("hash: fix MSVC link on GFNI stubs")
---
 lib/hash/rte_thash_gfni.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/hash/rte_thash_gfni.h +1 -1
index edae2e8..132f375 100644
@@ -71,7 +71,7 @@
 rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[],
 	uint32_t val[], uint32_t num)
 {
-	return rte_thash_gfni_bulk_stub(mtrx, len, tuple, val, num);
+	rte_thash_gfni_bulk_stub(mtrx, len, tuple, val, num);
 }
 
 #endif /* RTE_THASH_GFNI_DEFINED */
Signature · 1 line
1.8.3.1
#1 lore raw

Hello Tyler,

Quoted 17 lines · Tyler Retzlaff

rte_thash_gfni_bulk and rte_thash_gfni_bulk_stub both return void. Remove superfluous return statement from rte_thash_gfni_bulk.

Fixes 944a03a5cfc1 ("hash: fix MSVC link on GFNI stubs")
---
 lib/hash/rte_thash_gfni.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/hash/rte_thash_gfni.h +0 -0
index edae2e8..132f375 100644

lib/hash/rte_thash_gfni.h line 75

Quoted 6 lines
lib/hash/rte_thash_gfni.h +1 -1
@@ -71,7 +71,7 @@
 rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[],
        uint32_t val[], uint32_t num)
 {
-       return rte_thash_gfni_bulk_stub(mtrx, len, tuple, val, num);
+       rte_thash_gfni_bulk_stub(mtrx, len, tuple, val, num);
 }

I am surprised the CI did not catch it.
I need to pass -pedantic when compiling with this header, but no code does this in-tree.
How did you catch this issue?

Signature · 1 line
David Marchand
#2 lore raw
Quoted 16 lines · David Marchand

Hello Tyler,

Quoted 12 lines · Tyler Retzlaff

rte_thash_gfni_bulk and rte_thash_gfni_bulk_stub both return void. Remove superfluous return statement from rte_thash_gfni_bulk.

Fixes 944a03a5cfc1 ("hash: fix MSVC link on GFNI stubs")
---
 lib/hash/rte_thash_gfni.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

lib/hash/rte_thash_gfni.h line 75

Quoted 11 lines
lib/hash/rte_thash_gfni.h +1 -1
index edae2e8..132f375 100644
@@ -71,7 +71,7 @@
 rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[],
        uint32_t val[], uint32_t num)
 {
-       return rte_thash_gfni_bulk_stub(mtrx, len, tuple, val, num);
+       rte_thash_gfni_bulk_stub(mtrx, len, tuple, val, num);
 }

I am surprised the CI did not catch it.
I need to pass -pedantic when compiling with this header, but no code does this in-tree.
How did you catch this issue?

MSVC warns about it (and hundreds of other things). Benefits of compiling the same code with a compiler not sharing the same lineage.

Quoted 4 lines
Signature · 2 lines
-- 
David Marchand