Message ID | 20201208135543.11820-1-zhengyongjun3@huawei.com |
---|---|
State | Superseded |
Headers | show |
Series | [net-next] net/mlx4: simplify the return expression of mlx4_init_cq_table() | expand |
On Tue, 8 Dec 2020 21:55:43 +0800 Zheng Yongjun wrote: > diff --git a/drivers/net/ethernet/mellanox/mlx4/cq.c b/drivers/net/ethernet/mellanox/mlx4/cq.c > index 3b8576b9c2f9..68bd18ee6ee3 100644 > --- a/drivers/net/ethernet/mellanox/mlx4/cq.c > +++ b/drivers/net/ethernet/mellanox/mlx4/cq.c > @@ -462,19 +462,14 @@ EXPORT_SYMBOL_GPL(mlx4_cq_free); > int mlx4_init_cq_table(struct mlx4_dev *dev) > { > struct mlx4_cq_table *cq_table = &mlx4_priv(dev)->cq_table; > - int err; > > spin_lock_init(&cq_table->lock); > INIT_RADIX_TREE(&cq_table->tree, GFP_ATOMIC); > if (mlx4_is_slave(dev)) > return 0; > > - err = mlx4_bitmap_init(&cq_table->bitmap, dev->caps.num_cqs, > - dev->caps.num_cqs - 1, dev->caps.reserved_cqs, 0); > - if (err) > - return err; > - > - return 0; > + return mlx4_bitmap_init(&cq_table->bitmap, dev->caps.num_cqs, > + dev->caps.num_cqs - 1, dev->caps.reserved_cqs, 0); > } > > void mlx4_cleanup_cq_table(struct mlx4_dev *dev) Checkpatch reports the indentation is off here: ERROR: code indent should use tabs where possible #37: FILE: drivers/net/ethernet/mellanox/mlx4/cq.c:472: +^I^I^I dev->caps.num_cqs - 1, dev->caps.reserved_cqs, 0);$
From: Zheng Yongjun <zhengyongjun3@huawei.com> Date: Tue, 8 Dec 2020 21:55:43 +0800 > Simplify the return expression. > > Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Applied.
diff --git a/drivers/net/ethernet/mellanox/mlx4/cq.c b/drivers/net/ethernet/mellanox/mlx4/cq.c index 3b8576b9c2f9..68bd18ee6ee3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/cq.c @@ -462,19 +462,14 @@ EXPORT_SYMBOL_GPL(mlx4_cq_free); int mlx4_init_cq_table(struct mlx4_dev *dev) { struct mlx4_cq_table *cq_table = &mlx4_priv(dev)->cq_table; - int err; spin_lock_init(&cq_table->lock); INIT_RADIX_TREE(&cq_table->tree, GFP_ATOMIC); if (mlx4_is_slave(dev)) return 0; - err = mlx4_bitmap_init(&cq_table->bitmap, dev->caps.num_cqs, - dev->caps.num_cqs - 1, dev->caps.reserved_cqs, 0); - if (err) - return err; - - return 0; + return mlx4_bitmap_init(&cq_table->bitmap, dev->caps.num_cqs, + dev->caps.num_cqs - 1, dev->caps.reserved_cqs, 0); } void mlx4_cleanup_cq_table(struct mlx4_dev *dev)
Simplify the return expression. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> --- drivers/net/ethernet/mellanox/mlx4/cq.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)