Skip to contentSkip to conversation

net/mlx5: Fix some coding-style issues

PATCH Applied Weihang Li 2 participants 5 messages Apr 1, 2021 – Apr 7, 2021

Subsystems (5)
lore
Share & tools
lore

Weihang Li

author
#0 lore raw

cover net/mlx5: Fix some coding-style issues

Just make some cleanups according to the coding style of kernel.

Wenpeng Liang (3):
net/mlx5: Add a blank line after declarations.
net/mlx5: Remove return statement exist at the end of void function net/mlx5: Replace spaces with tab at the start of a line

 drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c    | 2 ++
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c     | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/lag.c        | 2 --
 drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c    | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/rdma.c       | 1 -
 6 files changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
2.8.1
author
#1 lore raw

PATCH 1/3 net/mlx5: Add a blank line after declarations.

From: Wenpeng Liang <[email protected]>

There should be a blank lines after declarations.

---
 drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c    | 2 ++
 drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c | 1 +
 2 files changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +2 -0
index 39475f6..254d4d7 100644
@@ -358,6 +358,7 @@ static void arfs_may_expire_flow(struct mlx5e_priv *priv)
 	int j;
 
 	HLIST_HEAD(del_list);
+
 	spin_lock_bh(&priv->fs.arfs.arfs_lock);
 	mlx5e_for_each_arfs_rule(arfs_rule, htmp, priv->fs.arfs.arfs_tables, i, j) {
 		if (!work_pending(&arfs_rule->arfs_work) &&
@@ -387,6 +388,7 @@ static void arfs_del_rules(struct mlx5e_priv *priv)
 	int j;
 
 	HLIST_HEAD(del_list);
+
 	spin_lock_bh(&priv->fs.arfs.arfs_lock);
 	mlx5e_for_each_arfs_rule(rule, htmp, priv->fs.arfs.arfs_tables, i, j) {
 		hlist_del_init(&rule->hlist);
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c +1 -0
index 22bee49..771114a 100644
@@ -1085,6 +1085,7 @@ static int fpga_ipsec_fs_create_fte(struct mlx5_flow_root_namespace *ns,
 	rule->ctx = mlx5_fpga_ipsec_fs_create_sa_ctx(dev, fte, is_egress);
 	if (IS_ERR(rule->ctx)) {
 		int err = PTR_ERR(rule->ctx);
+
 		kfree(rule);
 		return err;
 	}
Signature · 1 line
2.8.1
author
#2 lore raw

PATCH 2/3 net/mlx5: Remove return statement exist at the end of void function

In reply to Weihang Li

From: Wenpeng Liang <[email protected]>

void function return statements are not generally useful.

---
 drivers/net/ethernet/mellanox/mlx5/core/lag.c     | 2 --
 drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/rdma.c    | 1 -
 3 files changed, 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lag.c +0 -2
index 127bb92..b874839 100644
@@ -603,8 +603,6 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev)
 	if (err)
 		mlx5_core_err(dev, "Failed to init multipath lag err=%d\n",
 			      err);
-
-	return;
 }
 
 /* Must be called with intf_mutex held */
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +0 -1
index a61e09a..53541d3 100644
@@ -94,7 +94,6 @@ static void irq_set_name(char *name, int vecidx)
 
 	snprintf(name, MLX5_MAX_IRQ_NAME, "mlx5_comp%d",
 		 vecidx - MLX5_IRQ_VEC_COMP_BASE);
-	return;
 }
 
 static int request_irqs(struct mlx5_core_dev *dev, int nvec)
drivers/net/ethernet/mellanox/mlx5/core/rdma.c +0 -1
index 8e0dddc..441b545 100644
@@ -180,5 +180,4 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev)
 	mlx5_rdma_del_roce_addr(dev);
 disable_roce:
 	mlx5_nic_vport_disable_roce(dev);
-	return;
 }
Signature · 1 line
2.8.1
author
#3 lore raw

PATCH 3/3 net/mlx5: Replace spaces with tab at the start of a line

In reply to Weihang Li

From: Wenpeng Liang <[email protected]>

There should be no spaces at the start of the line.

---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +1 -1
index 9ef8e4a..739abfd 100644
@@ -52,7 +52,7 @@
 #include "diag/en_rep_tracepoint.h"
 
 #define MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE \
-        max(0x7, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
+	max(0x7, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
 #define MLX5E_REP_PARAMS_DEF_NUM_CHANNELS 1
 
 static const char mlx5e_rep_driver_name[] = "mlx5e_rep";
Signature · 1 line
2.8.1
#4 lore raw
In reply to Weihang Li
Quoted 7 lines · Weihang Li

Just make some cleanups according to the coding style of kernel.

Wenpeng Liang (3):
  net/mlx5: Add a blank line after declarations.
  net/mlx5: Remove return statement exist at the end of void function net/mlx5: Replace spaces with tab at the start of a line

Applied to net-next-mlx5, Thanks!