Skip to content

Commit e1168f0

Browse files
bvanasscherleon
authored andcommitted
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: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent fc772e3 commit e1168f0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/infiniband/core/iwcm.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,11 +1093,8 @@ static int cm_event_handler(struct iw_cm_id *cm_id,
10931093
}
10941094

10951095
refcount_inc(&cm_id_priv->refcount);
1096-
if (list_empty(&cm_id_priv->work_list)) {
1097-
list_add_tail(&work->list, &cm_id_priv->work_list);
1098-
queue_work(iwcm_wq, &work->work);
1099-
} else
1100-
list_add_tail(&work->list, &cm_id_priv->work_list);
1096+
list_add_tail(&work->list, &cm_id_priv->work_list);
1097+
queue_work(iwcm_wq, &work->work);
11011098
out:
11021099
spin_unlock_irqrestore(&cm_id_priv->lock, flags);
11031100
return ret;

0 commit comments

Comments
 (0)