[1/2] examples/ipsec-secgw: remove duplicated if check

Message ID 1587138115-13149-1-git-send-email-adwivedi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/2] examples/ipsec-secgw: remove duplicated if check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Ankur Dwivedi April 17, 2020, 3:41 p.m. UTC
  The two if check does the same task, so removing one.

Coverity Issue: 355669
Fixes: 9ad50c29d01d ("examples/ipsec-secgw: add app mode worker")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 examples/ipsec-secgw/ipsec_worker.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
  

Comments

Anoob Joseph April 17, 2020, 4:03 p.m. UTC | #1
> The two if check does the same task, so removing one.
> 
> Coverity Issue: 355669
> Fixes: 9ad50c29d01d ("examples/ipsec-secgw: add app mode worker")
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  examples/ipsec-secgw/ipsec_worker.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 

Acked-by: Anoob Joseph <anoobj@marvell.com>
  
Akhil Goyal April 17, 2020, 9:16 p.m. UTC | #2
> 
> > The two if check does the same task, so removing one.
> >
> > Coverity Issue: 355669
> > Fixes: 9ad50c29d01d ("examples/ipsec-secgw: add app mode worker")
> >
> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > ---
> >  examples/ipsec-secgw/ipsec_worker.c | 7 +------
> >  1 file changed, 1 insertion(+), 6 deletions(-)
> >
> 
> Acked-by: Anoob Joseph <anoobj@marvell.com>
> 
Series
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c
index 5fde667..b6c851f 100644
--- a/examples/ipsec-secgw/ipsec_worker.c
+++ b/examples/ipsec-secgw/ipsec_worker.c
@@ -112,12 +112,7 @@ 
 	rte_acl_classify((struct rte_acl_ctx *)sp, &nlp, &res, 1,
 			DEFAULT_MAX_CATEGORIES);
 
-	if (unlikely(res == 0)) {
-		/* No match */
-		return 0;
-	}
-
-	if (res == DISCARD)
+	if (unlikely(res == DISCARD))
 		return 0;
 	else if (res == BYPASS) {
 		*sa_idx = -1;