DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch
@ 2019-05-22  6:44 Andy Pei
  2019-05-23  2:27 ` Xu, Rosen
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Pei @ 2019-05-22  6:44 UTC (permalink / raw)
  To: dev; +Cc: andy.pei, rosen.xu, stable

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch
  2019-05-22  6:44 [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch Andy Pei
@ 2019-05-23  2:27 ` Xu, Rosen
  2019-06-18 13:30   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Xu, Rosen @ 2019-05-23  2:27 UTC (permalink / raw)
  To: Pei, Andy, dev; +Cc: stable

Hi,

> -----Original Message-----
> From: Pei, Andy
> Sent: Wednesday, May 22, 2019 14:45
> To: dev@dpdk.org
> Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> stable@dpdk.org
> 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")
> 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

Acked-by: Rosen Xu <rosen.xu@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch
  2019-05-23  2:27 ` Xu, Rosen
@ 2019-06-18 13:30   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2019-06-18 13:30 UTC (permalink / raw)
  To: Xu, Rosen, Pei, Andy, dev; +Cc: stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xu, Rosen
> Sent: Thursday, May 23, 2019 10:27 AM
> To: Pei, Andy <andy.pei@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch
> 
> Hi,
> 
> > -----Original Message-----
> > From: Pei, Andy
> > Sent: Wednesday, May 22, 2019 14:45
> > To: dev@dpdk.org
> > Cc: Pei, Andy <andy.pei@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> > stable@dpdk.org
> > 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")
> > Cc: rosen.xu@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Andy Pei <andy.pei@intel.com>
> > ---
> Acked-by: Rosen Xu <rosen.xu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-18 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  6:44 [dpdk-dev] [PATCH] net/ipn3ke: delete identical branch Andy Pei
2019-05-23  2:27 ` Xu, Rosen
2019-06-18 13:30   ` Zhang, Qi Z

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