drivers/infiniband/hw/amso1100: convert to using idr_alloc_cyclic
authorJeff Layton <jlayton@redhat.com>
Mon, 29 Apr 2013 23:21:18 +0000 (16:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:41 +0000 (18:28 -0700)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/infiniband/hw/amso1100/c2.h
drivers/infiniband/hw/amso1100/c2_qp.c

index ba7a1208ff9e708c25c59e09aeed4219f93da506..d619d735838bd76cd51db8451b6173732d5e3ad7 100644 (file)
@@ -265,7 +265,6 @@ struct c2_pd_table {
 struct c2_qp_table {
        struct idr idr;
        spinlock_t lock;
-       int last;
 };
 
 struct c2_element {
index 0ab826b280b27d4d9223ed27d7f3e36c41a831e2..86708dee58b1405c21694b5ea72a53808e2a3c1e 100644 (file)
@@ -385,8 +385,7 @@ static int c2_alloc_qpn(struct c2_dev *c2dev, struct c2_qp *qp)
        idr_preload(GFP_KERNEL);
        spin_lock_irq(&c2dev->qp_table.lock);
 
-       ret = idr_alloc(&c2dev->qp_table.idr, qp, c2dev->qp_table.last++, 0,
-                       GFP_NOWAIT);
+       ret = idr_alloc_cyclic(&c2dev->qp_table.idr, qp, 0, 0, GFP_NOWAIT);
        if (ret >= 0)
                qp->qpn = ret;