Skip to contentSkip to conversation

net/mlx5: Remove unneeded variable in mlx5_unload_one

PATCH Applied zhong jiang 3 participants 4 messages Sep 12, 2019 – Sep 23, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: Remove unneeded variable in mlx5_unload_one

mlx5_unload_one do not need local variable to store different value, Hence just remove it.

---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -3
index 9648c22..c39bb37 100644
@@ -1228,8 +1228,6 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
 
 static int mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
 {
-	int err = 0;
-
 	if (cleanup) {
 		mlx5_unregister_device(dev);
 		mlx5_drain_health_wq(dev);
@@ -1257,7 +1255,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
 	mlx5_function_teardown(dev, cleanup);
 out:
 	mutex_unlock(&dev->intf_state_mutex);
-	return err;
+	return 0;
 }
 
 static int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
Signature · 1 line
1.7.12.4
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · zhong jiang

mlx5_unload_one do not need local variable to store different value, Hence just remove it.

---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/main.c +0 -2
index 9648c22..c39bb37 100644
@@ -1228,8 +1228,6 @@ static int mlx5_load_one(struct mlx5_core_dev
 *dev, bool boot)
 
 static int mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
 {
-	int err = 0;
-
 	if (cleanup) {
 		mlx5_unregister_device(dev);
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -1
 		mlx5_drain_health_wq(dev);
@@ -1257,7 +1255,7 @@ static int mlx5_unload_one(struct mlx5_core_dev
 *dev, bool cleanup)
 	mlx5_function_teardown(dev, cleanup);
 out:
 	mutex_unlock(&dev->intf_state_mutex);
-	return err;
+	return 0;
 }
 
Quoted 2 lines

static int mlx5_mdev_init(struct mlx5_core_dev *dev, int
profile_idx)

#3 lore raw
Quoted 11 lines · David Miller

From: zhong jiang <[email protected]>
Date: Fri, 13 Sep 2019 00:59:02 +0800

Quoted 1 line

mlx5_unload_one do not need local variable to store different

value,

Quoted 3 lines

Hence just remove it.

Saeed, just take this directly via one of your trees.

Applied to net-next-mlx5.

Thanks,
Saeed.