DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andy Pei <andy.pei@intel.com>
To: dev@dpdk.org
Cc: andy.pei@intel.com, rosen.xu@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch
Date: Wed, 22 May 2019 14:44:42 +0800	[thread overview]
Message-ID: <1558507482-350757-1-git-send-email-andy.pei@intel.com> (raw)

Whether the if statement is ture or not,
the operation is identical.
It is unnecessary to check the if statement,
so just delete the if statement.

Coverity issue: 337928
Fixes: c820468ac99c ("net/ipn3ke: support TM")
Cc: rosen.xu@intel.com
Cc: stable@dpdk.org

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 drivers/net/ipn3ke/ipn3ke_tm.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index 4bcf3aa..39c49bc 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -1541,23 +1541,12 @@ struct ipn3ke_tm_shaper_params_range_type ipn3ke_tm_shaper_params_rang[] = {
 						NULL,
 						rte_strerror(EINVAL));
 			}
-		} else if (n->node_state ==
-			IPN3KE_TM_NODE_STATE_CONFIGURED_DEL) {
-			if (n->level != IPN3KE_TM_NODE_LEVEL_VT ||
-				n->n_children != 0) {
-				return -rte_tm_error_set(error,
-						EINVAL,
-						RTE_TM_ERROR_TYPE_UNSPECIFIED,
-						NULL,
-						rte_strerror(EINVAL));
-			} else {
-				return -rte_tm_error_set(error,
+		} else if (n->node_state == IPN3KE_TM_NODE_STATE_CONFIGURED_DEL)
+			return -rte_tm_error_set(error,
 						EINVAL,
 						RTE_TM_ERROR_TYPE_UNSPECIFIED,
 						NULL,
 						rte_strerror(EINVAL));
-			}
-		}
 	}
 
 	n = tm->h.port_commit_node;
-- 
1.8.3.1


             reply	other threads:[~2019-05-22  6:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  6:44 Andy Pei [this message]
2019-05-23  2:27 ` Xu, Rosen
2019-06-18 13:30   ` Zhang, Qi Z

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=1558507482-350757-1-git-send-email-andy.pei@intel.com \
    --to=andy.pei@intel.com \
    --cc=dev@dpdk.org \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    /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).