Commit e1168f09 authored by Bart Van Assche's avatar Bart Van Assche Committed by Leon Romanovsky

RDMA/iwcm: Simplify cm_event_handler()

queue_work() can test efficiently whether or not work is pending. Hence,
simplify cm_event_handler() by always calling queue_work() instead of only
if the list with pending work is empty.
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240605145117.397751-4-bvanassche@acm.orgSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent fc772e38
...@@ -1093,11 +1093,8 @@ static int cm_event_handler(struct iw_cm_id *cm_id, ...@@ -1093,11 +1093,8 @@ static int cm_event_handler(struct iw_cm_id *cm_id,
} }
refcount_inc(&cm_id_priv->refcount); refcount_inc(&cm_id_priv->refcount);
if (list_empty(&cm_id_priv->work_list)) { list_add_tail(&work->list, &cm_id_priv->work_list);
list_add_tail(&work->list, &cm_id_priv->work_list); queue_work(iwcm_wq, &work->work);
queue_work(iwcm_wq, &work->work);
} else
list_add_tail(&work->list, &cm_id_priv->work_list);
out: out:
spin_unlock_irqrestore(&cm_id_priv->lock, flags); spin_unlock_irqrestore(&cm_id_priv->lock, flags);
return ret; return ret;
......
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