examples/ipsec-secgw: remove duplicated check
authorAnkur Dwivedi <adwivedi@marvell.com>
Fri, 17 Apr 2020 15:41:54 +0000 (21:11 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Sun, 19 Apr 2020 15:15:14 +0000 (17:15 +0200)
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>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw/ipsec_worker.c

index 5fde667..b6c851f 100644 (file)
@@ -112,12 +112,7 @@ check_sp(struct sp_ctx *sp, const uint8_t *nlp, uint32_t *sa_idx)
        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;