[openib-general] [PATCH 4/5] 2.6.19 rdma_cm: eliminate unnecessary remove list

Sean Hefty sean.hefty at intel.com
Fri Sep 29 12:03:35 PDT 2006


Eliminate remove_list by using list_del_init instead during device removal
handling.

Signed-off-by: Krishna Kumar <krkumar2 at in.ibm.com>
Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
This removes a stack variable and simplifies the code, but does not fix
any bugs.  We can defer this to 2.6.20 if necessary.

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index d10fdf1..3982b81 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2151,12 +2151,9 @@ static int cma_remove_id_dev(struct rdma
 
 static void cma_process_remove(struct cma_device *cma_dev)
 {
-	struct list_head remove_list;
 	struct rdma_id_private *id_priv;
 	int ret;
 
-	INIT_LIST_HEAD(&remove_list);
-
 	mutex_lock(&lock);
 	while (!list_empty(&cma_dev->id_list)) {
 		id_priv = list_entry(cma_dev->id_list.next,
@@ -2167,8 +2164,7 @@ static void cma_process_remove(struct cm
 			continue;
 		}
 
-		list_del(&id_priv->list);
-		list_add_tail(&id_priv->list, &remove_list);
+		list_del_init(&id_priv->list);
 		atomic_inc(&id_priv->refcount);
 		mutex_unlock(&lock);
 





More information about the general mailing list