From patchwork Wed Mar 27 19:29:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2352951 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4FAC1DFE82 for ; Wed, 27 Mar 2013 19:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754114Ab3C0TcJ (ORCPT ); Wed, 27 Mar 2013 15:32:09 -0400 Received: from mail-oa0-f49.google.com ([209.85.219.49]:37957 "EHLO mail-oa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754232Ab3C0T3p (ORCPT ); Wed, 27 Mar 2013 15:29:45 -0400 Received: by mail-oa0-f49.google.com with SMTP id j6so9313797oag.36 for ; Wed, 27 Mar 2013 12:29:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=+quJm/WyOf8d+Sn9N2twds1nPtUdrBUrOjtbLdFWRPU=; b=MjIGjGSKuUFEwBBXneVXmNoRBQISKPkl4lhmf9kn8IRrciJvRTVVzWkDt1+L6X1HTS keKe5KAnAFj40GaE1r2pwycTknZOGdZg5GgbwXzlfR7NNXA8ViSe7anbmV0HaI5XLgqt ocuBbeAYnmSVmOelgfy2OTR4yWV4nsIGI873dWF9vbym3srLuv8OrcT7V6heTNH2gtkH Ku5PhKONZyzvdBe/RhTsFvUmzPDFCB0ADxE59PznqDqAvYnv69gYj92cBSTpaKjfZu5Q nSpcW8eyOegL7hTGaP75ZyaREJwIpvuoESgGBvDb0jrWeYl/NIJspiQ6ez76Q91WiCiB bcMw== X-Received: by 10.182.136.72 with SMTP id py8mr4332121obb.0.1364412584984; Wed, 27 Mar 2013 12:29:44 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id t9sm21559418obk.13.2013.03.27.12.29.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Mar 2013 12:29:44 -0700 (PDT) From: Jeff Layton To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, tj@kernel.org, Steve Wise , Tom Tucker , linux-rdma@vger.kernel.org Subject: [PATCH v2 2/6] amso1100: convert to using idr_alloc_cyclic Date: Wed, 27 Mar 2013 15:29:34 -0400 Message-Id: <1364412578-7462-3-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1364412578-7462-1-git-send-email-jlayton@redhat.com> References: <1364412578-7462-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQkGtV9fkpR6rUJ580VU/ZsRjOzx3+mTSbTXWXvXJCWqmu1P3pBpU+YIgmPTZCYw2hPIyT3R Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org (Note: compile-tested only) Signed-off-by: Jeff Layton Cc: Tejun Heo Cc: Steve Wise Cc: Tom Tucker Cc: linux-rdma@vger.kernel.org Reviewed-by: Tejun Heo --- drivers/infiniband/hw/amso1100/c2.h | 1 - drivers/infiniband/hw/amso1100/c2_qp.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/amso1100/c2.h b/drivers/infiniband/hw/amso1100/c2.h index ba7a1208..d619d73 100644 --- a/drivers/infiniband/hw/amso1100/c2.h +++ b/drivers/infiniband/hw/amso1100/c2.h @@ -265,7 +265,6 @@ struct c2_pd_table { struct c2_qp_table { struct idr idr; spinlock_t lock; - int last; }; struct c2_element { diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c index 0ab826b..86708de 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) 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;