aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-04-29 19:21:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:41 -0400
commitc027e44677e139d68197f25688f0c58291b26c90 (patch)
tree6b1fb90e85c8da8ccccff68d90aecd2d3e87274f /drivers/infiniband
parent3e6628c4b347a558965041290c5a92791dd4c741 (diff)
drivers/infiniband/hw/amso1100: convert to using idr_alloc_cyclic
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/amso1100/c2.h1
-rw-r--r--drivers/infiniband/hw/amso1100/c2_qp.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2.h b/drivers/infiniband/hw/amso1100/c2.h
index ba7a1208ff9e..d619d735838b 100644
--- a/drivers/infiniband/hw/amso1100/c2.h
+++ b/drivers/infiniband/hw/amso1100/c2.h
@@ -265,7 +265,6 @@ struct c2_pd_table {
265struct c2_qp_table { 265struct c2_qp_table {
266 struct idr idr; 266 struct idr idr;
267 spinlock_t lock; 267 spinlock_t lock;
268 int last;
269}; 268};
270 269
271struct c2_element { 270struct c2_element {
diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c
index 0ab826b280b2..86708dee58b1 100644
--- a/drivers/infiniband/hw/amso1100/c2_qp.c
+++ b/drivers/infiniband/hw/amso1100/c2_qp.c
@@ -385,8 +385,7 @@ static int c2_alloc_qpn(struct c2_dev *c2dev, struct c2_qp *qp)
385 idr_preload(GFP_KERNEL); 385 idr_preload(GFP_KERNEL);
386 spin_lock_irq(&c2dev->qp_table.lock); 386 spin_lock_irq(&c2dev->qp_table.lock);
387 387
388 ret = idr_alloc(&c2dev->qp_table.idr, qp, c2dev->qp_table.last++, 0, 388 ret = idr_alloc_cyclic(&c2dev->qp_table.idr, qp, 0, 0, GFP_NOWAIT);
389 GFP_NOWAIT);
390 if (ret >= 0) 389 if (ret >= 0)
391 qp->qpn = ret; 390 qp->qpn = ret;
392 391