Commit 909624d8 authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

IB/cm: Use container_of() instead of typecast

Use container_of() macro to get to timewait info structure instead of
typecasting.

Link: https://lore.kernel.org/r/20191002122517.17721-5-leon@kernel.orgSigned-off-by: default avatarParav Pandit <parav@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 6f26b2ac
...@@ -246,7 +246,7 @@ struct cm_work { ...@@ -246,7 +246,7 @@ struct cm_work {
}; };
struct cm_timewait_info { struct cm_timewait_info {
struct cm_work work; /* Must be first. */ struct cm_work work;
struct list_head list; struct list_head list;
struct rb_node remote_qp_node; struct rb_node remote_qp_node;
struct rb_node remote_id_node; struct rb_node remote_id_node;
...@@ -3434,7 +3434,7 @@ static int cm_timewait_handler(struct cm_work *work) ...@@ -3434,7 +3434,7 @@ static int cm_timewait_handler(struct cm_work *work)
struct cm_id_private *cm_id_priv; struct cm_id_private *cm_id_priv;
int ret; int ret;
timewait_info = (struct cm_timewait_info *)work; timewait_info = container_of(work, struct cm_timewait_info, work);
spin_lock_irq(&cm.lock); spin_lock_irq(&cm.lock);
list_del(&timewait_info->list); list_del(&timewait_info->list);
spin_unlock_irq(&cm.lock); spin_unlock_irq(&cm.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment