net/mlx5: simplify the return expression of mlx5_ec_init()
authorQinglang Miao <miaoqinglang@huawei.com>
Mon, 21 Sep 2020 13:10:44 +0000 (21:10 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 23 Sep 2020 22:44:39 +0000 (15:44 -0700)
Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c

index a894ea9..3dc9dd3 100644 (file)
@@ -43,19 +43,13 @@ static void mlx5_peer_pf_cleanup(struct mlx5_core_dev *dev)
 
 int mlx5_ec_init(struct mlx5_core_dev *dev)
 {
-       int err = 0;
-
        if (!mlx5_core_is_ecpf(dev))
                return 0;
 
        /* ECPF shall enable HCA for peer PF in the same way a PF
         * does this for its VFs.
         */
-       err = mlx5_peer_pf_init(dev);
-       if (err)
-               return err;
-
-       return 0;
+       return mlx5_peer_pf_init(dev);
 }
 
 void mlx5_ec_cleanup(struct mlx5_core_dev *dev)