DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ankur Dwivedi <adwivedi@marvell.com>
To: <dev@dpdk.org>
Cc: <lbartosik@marvell.com>, <anoobj@marvell.com>,
	Ankur Dwivedi <adwivedi@marvell.com>
Subject: [dpdk-dev] [PATCH 1/2] examples/ipsec-secgw: remove duplicated if check
Date: Fri, 17 Apr 2020 21:11:54 +0530	[thread overview]
Message-ID: <1587138115-13149-1-git-send-email-adwivedi@marvell.com> (raw)

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(-)

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;
-- 
1.9.3


             reply	other threads:[~2020-04-17 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 15:41 Ankur Dwivedi [this message]
2020-04-17 15:41 ` [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: check return value of function Ankur Dwivedi
2020-04-17 16:05   ` Anoob Joseph
2020-04-17 16:03 ` [dpdk-dev] [PATCH 1/2] examples/ipsec-secgw: remove duplicated if check Anoob Joseph
2020-04-17 21:16   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587138115-13149-1-git-send-email-adwivedi@marvell.com \
    --to=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=lbartosik@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).