[dpdk-dev] [PATCH] net/ipn3ke: delete identical branch
Xu, Rosen
rosen.xu at intel.com
Thu May 23 04:27:08 CEST 2019
Hi,
> -----Original Message-----
> From: Pei, Andy
> Sent: Wednesday, May 22, 2019 14:45
> To: dev at dpdk.org
> Cc: Pei, Andy <andy.pei at intel.com>; Xu, Rosen <rosen.xu at intel.com>;
> stable at 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 at intel.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Andy Pei <andy.pei at 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 at intel.com>
More information about the dev
mailing list