Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c027e446 authored by Jeff Layton's avatar Jeff Layton Committed by Linus Torvalds
Browse files

drivers/infiniband/hw/amso1100: convert to using idr_alloc_cyclic



Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Reviewed-by: default avatarTejun Heo <tj@kernel.org>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3e6628c4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -265,7 +265,6 @@ struct c2_pd_table {
struct c2_qp_table {
	struct idr idr;
	spinlock_t lock;
	int last;
};

struct c2_element {
+1 −2
Original line number Diff line number Diff line
@@ -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;