summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2024-06-05 08:50:59 -0600
committerLeon Romanovsky <leon@kernel.org>2024-06-09 11:15:27 +0300
commite1168f09b3314992f1c5251f3793102035da7237 (patch)
tree19e144a9a539d8801056d4bb672ce3dc66334c8e /drivers/infiniband
parentfc772e38bce5635bc1d7efae7198a305504ad112 (diff)
downloadlinux-stable-e1168f09b3314992f1c5251f3793102035da7237.tar.gz
linux-stable-e1168f09b3314992f1c5251f3793102035da7237.tar.bz2
linux-stable-e1168f09b3314992f1c5251f3793102035da7237.zip
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 <bvanassche@acm.org> Link: https://lore.kernel.org/r/20240605145117.397751-4-bvanassche@acm.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/iwcm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index ae9c12409f8a..3d66aec36899 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -1093,11 +1093,8 @@ static int cm_event_handler(struct iw_cm_id *cm_id,
}
refcount_inc(&cm_id_priv->refcount);
- if (list_empty(&cm_id_priv->work_list)) {
- list_add_tail(&work->list, &cm_id_priv->work_list);
- queue_work(iwcm_wq, &work->work);
- } else
- 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);
out:
spin_unlock_irqrestore(&cm_id_priv->lock, flags);
return ret;