OSDN Git Service

net/mlx5: remove many unnecessary NULL values
authorRuan Jinjie <ruanjinjie@huawei.com>
Fri, 4 Aug 2023 01:43:44 +0000 (09:43 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 7 Aug 2023 17:53:52 +0000 (10:53 -0700)
There are many pointers assigned first, which need not to be
initialized, so remove the NULL assignments.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c
drivers/net/ethernet/mellanox/mlx5/core/lib/hv_vhca.c

index 39c03dc..e5c1012 100644 (file)
@@ -57,7 +57,7 @@ static const char * const mlx5_fpga_qp_error_strings[] = {
 };
 static struct mlx5_fpga_device *mlx5_fpga_device_alloc(void)
 {
-       struct mlx5_fpga_device *fdev = NULL;
+       struct mlx5_fpga_device *fdev;
 
        fdev = kzalloc(sizeof(*fdev), GFP_KERNEL);
        if (!fdev)
@@ -252,7 +252,7 @@ out:
 
 int mlx5_fpga_init(struct mlx5_core_dev *mdev)
 {
-       struct mlx5_fpga_device *fdev = NULL;
+       struct mlx5_fpga_device *fdev;
 
        if (!MLX5_CAP_GEN(mdev, fpga)) {
                mlx5_core_dbg(mdev, "FPGA capability not present\n");
index 4047629..30564d9 100644 (file)
@@ -40,7 +40,7 @@ struct mlx5_hv_vhca_agent {
 
 struct mlx5_hv_vhca *mlx5_hv_vhca_create(struct mlx5_core_dev *dev)
 {
-       struct mlx5_hv_vhca *hv_vhca = NULL;
+       struct mlx5_hv_vhca *hv_vhca;
 
        hv_vhca = kzalloc(sizeof(*hv_vhca), GFP_KERNEL);
        if (!hv_vhca)