[dpdk-dev] [v2 PATCH 4/8] net/ipn3ke: remove useless if statement
Xu, Rosen
rosen.xu at intel.com
Fri Nov 8 15:49:30 CET 2019
Hi,
> -----Original Message-----
> From: Kevin Traynor [mailto:ktraynor at redhat.com]
> Sent: Thursday, November 07, 2019 3:02
> To: dev at dpdk.org
> Cc: david.marchand at redhat.com; Kevin Traynor <ktraynor at redhat.com>;
> Xu, Rosen <rosen.xu at intel.com>; stable at dpdk.org
> Subject: [v2 PATCH 4/8] net/ipn3ke: remove useless if statement
>
> Coverity complains that this statement is not needed as the goto label is on
> the next line anyway. Remove the if statement.
>
> 653 ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> CID 337930 (#1 of 1): Identical code for different branches
> (IDENTICAL_BRANCHES)identical_branches: The same code is executed
> when the condition ret is true or false, because the code in the
> if-then branch and after the if statement is identical. Should
> the if statement be removed?
> 654 if (ret)
> 655 goto end;
> implicit_else: The code from the above if-then branch is identical
> to the code after the if statement.
> 656end:
>
> Coverity issue: 337930
> Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")
> Cc: rosen.xu at intel.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
> Reviewed-by: David Marchand <david.marchand at redhat.com>
> ---
> drivers/net/ipn3ke/ipn3ke_ethdev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> index 28d8aaf2d..af87fda6b 100644
> --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
> +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
> @@ -738,6 +738,5 @@ ipn3ke_cfg_probe(struct rte_vdev_device *dev)
>
> ret = ipn3ke_cfg_parse_i40e_pf_ethdev(afu_name, pf_name);
> - if (ret)
> - goto end;
> +
> end:
> if (kvlist)
> --
> 2.21.0
Reviewed-by: Rosen Xu <rosen.xu at intel.com>
More information about the dev
mailing list