hash: remove return statement from function returning void

Message ID 1709932817-29583-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series hash: remove return statement from function returning void |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS

Commit Message

Tyler Retzlaff March 8, 2024, 9:20 p.m. UTC
  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")
Cc: stephen@networkplumber.org

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/hash/rte_thash_gfni.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand March 14, 2024, 3:58 p.m. UTC | #1
Hello Tyler,

On Fri, Mar 8, 2024 at 10:20 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> 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")
> Cc: stephen@networkplumber.org
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
>  lib/hash/rte_thash_gfni.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h
> index edae2e8..132f375 100644
> --- a/lib/hash/rte_thash_gfni.h
> +++ b/lib/hash/rte_thash_gfni.h
> @@ -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?
  
Tyler Retzlaff March 14, 2024, 4:30 p.m. UTC | #2
On Thu, Mar 14, 2024 at 04:58:54PM +0100, David Marchand wrote:
> Hello Tyler,
> 
> On Fri, Mar 8, 2024 at 10:20 PM Tyler Retzlaff
> <roretzla@linux.microsoft.com> wrote:
> >
> > 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")
> > Cc: stephen@networkplumber.org
> >
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > ---
> >  lib/hash/rte_thash_gfni.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h
> > index edae2e8..132f375 100644
> > --- a/lib/hash/rte_thash_gfni.h
> > +++ b/lib/hash/rte_thash_gfni.h
> > @@ -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.

> 
> 
> -- 
> David Marchand
  
Tyler Retzlaff April 4, 2024, 6:19 p.m. UTC | #3
Recheck-request: iol-unit-amd64-testing
  
Thomas Monjalon May 16, 2024, 4:58 p.m. UTC | #4
08/03/2024 22:20, 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")
> Cc: stephen@networkplumber.org
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Applied, thanks.
  

Patch

diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h
index edae2e8..132f375 100644
--- a/lib/hash/rte_thash_gfni.h
+++ b/lib/hash/rte_thash_gfni.h
@@ -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 */