Skip to contentSkip to conversation

net/ipn3ke: delete identical branch

PATCH Applied Andy Pei 3 participants 3 messages May 22, 2019 – Jun 18, 2019 Network drivers

lore
Share & tools
lore

Andy Pei

author
#0 lore raw

PATCH 1/1 net/ipn3ke: delete identical branch

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")
---
 drivers/net/ipn3ke/ipn3ke_tm.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/net/ipn3ke/ipn3ke_tm.c +2 -13
index 4bcf3aa..39c49bc 100644
@@ -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;
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 56 lines

-----Original Message-----
From: Pei, Andy
Sent: Wednesday, May 22, 2019 14:45
To: [email protected]
Cc: Pei, Andy <[email protected]>; Xu, Rosen <[email protected]>; [email protected]
Subject: [PATCH] net/ipn3ke: delete identical branch

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")
---
 drivers/net/ipn3ke/ipn3ke_tm.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ipn3ke/ipn3ke_tm.c index 4bcf3aa..39c49bc 100644

drivers/net/ipn3ke/ipn3ke_tm.c +2 -14
@@ -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;
--
Quoted 1 line

1.8.3.1

Applied
#2 lore raw
Quoted 22 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Xu, Rosen
Sent: Thursday, May 23, 2019 10:27 AM
To: Pei, Andy <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch

Hi,

Quoted 11 lines

-----Original Message-----
From: Pei, Andy
Sent: Wednesday, May 22, 2019 14:45
To: [email protected]
Cc: Pei, Andy <[email protected]>; Xu, Rosen <[email protected]>; [email protected]
Subject: [PATCH] net/ipn3ke: delete identical branch

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.

Quoted 8 lines
Quoted 7 lines

Coverity issue: 337928

Fixes c820468ac99c ("net/ipn3ke: support TM")

---

Applied to dpdk-next-net-intel.

Thanks
Qi