* [PATCH rdma-next 0/4] Unrelated code cleanups
@ 2019-10-02 12:25 Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 1/4] RDMA/mlx5: Group boolean parameters to take less space Leon Romanovsky
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-10-02 12:25 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Leon Romanovsky, RDMA mailing list, Erez Alfasi, Parav Pandit
From: Leon Romanovsky <leonro@mellanox.com>
Hi,
Various code cleanups.
Thanks
Erez Alfasi (2):
IB/mlx5: Remove unnecessary return statement
IB/mlx5: Remove unnecessary else statement
Leon Romanovsky (1):
RDMA/mlx5: Group boolean parameters to take less space
Parav Pandit (1):
IB/cm: Use container_of() instead of typecast
drivers/infiniband/core/cm.c | 4 ++--
drivers/infiniband/hw/mlx5/main.c | 4 ++--
drivers/infiniband/hw/mlx5/mlx5_ib.h | 8 ++++----
drivers/infiniband/hw/mlx5/odp.c | 2 --
4 files changed, 8 insertions(+), 10 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH rdma-next 1/4] RDMA/mlx5: Group boolean parameters to take less space
2019-10-02 12:25 [PATCH rdma-next 0/4] Unrelated code cleanups Leon Romanovsky
@ 2019-10-02 12:25 ` Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 2/4] IB/mlx5: Remove unnecessary return statement Leon Romanovsky
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-10-02 12:25 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Leon Romanovsky, RDMA mailing list, Erez Alfasi, Parav Pandit
From: Leon Romanovsky <leonro@mellanox.com>
Clean the code to store all boolean parameters inside one variable.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/hw/mlx5/mlx5_ib.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 2ceaef3ea3fb..bf30d53d94dc 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -958,7 +958,10 @@ struct mlx5_ib_dev {
/* serialize update of capability mask
*/
struct mutex cap_mask_mutex;
- bool ib_active;
+ u8 ib_active:1;
+ u8 fill_delay:1;
+ u8 is_rep:1;
+ u8 lag_active:1;
struct umr_common umrc;
/* sync used page count stats
*/
@@ -967,7 +970,6 @@ struct mlx5_ib_dev {
struct timer_list delay_timer;
/* Prevents soft lock on massive reg MRs */
struct mutex slow_path_mutex;
- int fill_delay;
struct ib_odp_caps odp_caps;
u64 odp_max_size;
struct mlx5_ib_pf_eq odp_pf_eq;
@@ -988,8 +990,6 @@ struct mlx5_ib_dev {
struct mlx5_sq_bfreg fp_bfreg;
struct mlx5_ib_delay_drop delay_drop;
const struct mlx5_ib_profile *profile;
- bool is_rep;
- int lag_active;
struct mlx5_ib_lb_state lb;
u8 umr_fence;
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH rdma-next 2/4] IB/mlx5: Remove unnecessary return statement
2019-10-02 12:25 [PATCH rdma-next 0/4] Unrelated code cleanups Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 1/4] RDMA/mlx5: Group boolean parameters to take less space Leon Romanovsky
@ 2019-10-02 12:25 ` Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 3/4] IB/mlx5: Remove unnecessary else statement Leon Romanovsky
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-10-02 12:25 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Leon Romanovsky, RDMA mailing list, Erez Alfasi, Parav Pandit
From: Erez Alfasi <ereza@mellanox.com>
There is no reason to call return at the end of function which
returns void. Remove this unnecessary statement.
Signed-off-by: Erez Alfasi <ereza@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/hw/mlx5/odp.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
index 2e9b43061797..95cf0249b015 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -359,8 +359,6 @@ void mlx5_ib_internal_fill_odp_caps(struct mlx5_ib_dev *dev)
MLX5_CAP_GEN(dev->mdev, umr_extended_translation_offset) &&
!MLX5_CAP_GEN(dev->mdev, umr_indirect_mkey_disabled))
caps->general_caps |= IB_ODP_SUPPORT_IMPLICIT;
-
- return;
}
static void mlx5_ib_page_fault_resume(struct mlx5_ib_dev *dev,
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH rdma-next 3/4] IB/mlx5: Remove unnecessary else statement
2019-10-02 12:25 [PATCH rdma-next 0/4] Unrelated code cleanups Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 1/4] RDMA/mlx5: Group boolean parameters to take less space Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 2/4] IB/mlx5: Remove unnecessary return statement Leon Romanovsky
@ 2019-10-02 12:25 ` Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 4/4] IB/cm: Use container_of() instead of typecast Leon Romanovsky
2019-10-04 18:49 ` [PATCH rdma-next 0/4] Unrelated code cleanups Jason Gunthorpe
4 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-10-02 12:25 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Leon Romanovsky, RDMA mailing list, Erez Alfasi, Parav Pandit
From: Erez Alfasi <ereza@mellanox.com>
'else' is not generally useful after a break or
return. Remove this unnecessary statement.
Signed-off-by: Erez Alfasi <ereza@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/hw/mlx5/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 831539419c30..b95c2b05f682 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -844,8 +844,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
resp_len = sizeof(resp.comp_mask) + sizeof(resp.response_length);
if (uhw->outlen && uhw->outlen < resp_len)
return -EINVAL;
- else
- resp.response_length = resp_len;
+
+ resp.response_length = resp_len;
if (uhw->inlen && !ib_is_udata_cleared(uhw, 0, uhw->inlen))
return -EINVAL;
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH rdma-next 4/4] IB/cm: Use container_of() instead of typecast
2019-10-02 12:25 [PATCH rdma-next 0/4] Unrelated code cleanups Leon Romanovsky
` (2 preceding siblings ...)
2019-10-02 12:25 ` [PATCH rdma-next 3/4] IB/mlx5: Remove unnecessary else statement Leon Romanovsky
@ 2019-10-02 12:25 ` Leon Romanovsky
2019-10-04 18:49 ` [PATCH rdma-next 0/4] Unrelated code cleanups Jason Gunthorpe
4 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-10-02 12:25 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Leon Romanovsky, RDMA mailing list, Erez Alfasi, Parav Pandit
From: Parav Pandit <parav@mellanox.com>
Use container_of() macro to get to timewait info structure instead of
typecasting.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/core/cm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index da10e6ccb43c..c0aa3a4b4cfd 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -246,7 +246,7 @@ struct cm_work {
};
struct cm_timewait_info {
- struct cm_work work; /* Must be first. */
+ struct cm_work work;
struct list_head list;
struct rb_node remote_qp_node;
struct rb_node remote_id_node;
@@ -3434,7 +3434,7 @@ static int cm_timewait_handler(struct cm_work *work)
struct cm_id_private *cm_id_priv;
int ret;
- timewait_info = (struct cm_timewait_info *)work;
+ timewait_info = container_of(work, struct cm_timewait_info, work);
spin_lock_irq(&cm.lock);
list_del(&timewait_info->list);
spin_unlock_irq(&cm.lock);
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH rdma-next 0/4] Unrelated code cleanups
2019-10-02 12:25 [PATCH rdma-next 0/4] Unrelated code cleanups Leon Romanovsky
` (3 preceding siblings ...)
2019-10-02 12:25 ` [PATCH rdma-next 4/4] IB/cm: Use container_of() instead of typecast Leon Romanovsky
@ 2019-10-04 18:49 ` Jason Gunthorpe
4 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2019-10-04 18:49 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Erez Alfasi,
Parav Pandit
On Wed, Oct 02, 2019 at 03:25:13PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
>
> Hi,
>
> Various code cleanups.
>
> Thanks
>
> Erez Alfasi (2):
> IB/mlx5: Remove unnecessary return statement
> IB/mlx5: Remove unnecessary else statement
>
> Leon Romanovsky (1):
> RDMA/mlx5: Group boolean parameters to take less space
>
> Parav Pandit (1):
> IB/cm: Use container_of() instead of typecast
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-10-04 18:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 12:25 [PATCH rdma-next 0/4] Unrelated code cleanups Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 1/4] RDMA/mlx5: Group boolean parameters to take less space Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 2/4] IB/mlx5: Remove unnecessary return statement Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 3/4] IB/mlx5: Remove unnecessary else statement Leon Romanovsky
2019-10-02 12:25 ` [PATCH rdma-next 4/4] IB/cm: Use container_of() instead of typecast Leon Romanovsky
2019-10-04 18:49 ` [PATCH rdma-next 0/4] Unrelated code cleanups Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).