RDMA/cma: Eliminate unnecessary remove_list
authorKrishna Kumar <krkumar2@in.ibm.com>
Fri, 29 Sep 2006 19:03:35 +0000 (12:03 -0700)
committerRoland Dreier <rolandd@cisco.com>
Mon, 2 Oct 2006 21:52:16 +0000 (14:52 -0700)
Eliminate remove_list by using list_del_init() instead during device
removal handling.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/cma.c

index d10fdf1419b1b56f9f3b8d4c6a27df5ccef87b5f..3982b81d33cf7701ae08dd30801da951ac4acf5f 100644 (file)
@@ -2151,12 +2151,9 @@ static int cma_remove_id_dev(struct rdma_id_private *id_priv)
 
 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 cma_device *cma_dev)
                        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);