Skip to content

Commit

Permalink
drivers/infiniband/hw/amso1100: convert to using idr_alloc_cyclic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and Linus Torvalds committed Apr 30, 2013
1 parent 3e6628c commit c027e44
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion drivers/infiniband/hw/amso1100/c2.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ struct c2_pd_table {
struct c2_qp_table {
struct idr idr;
spinlock_t lock;
int last;
};

struct c2_element {
Expand Down
3 changes: 1 addition & 2 deletions drivers/infiniband/hw/amso1100/c2_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c027e44

Please sign in to comment.