From patchwork Tue Feb 2 19:09:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Chiang X-Patchwork-Id: 76484 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o12JBwjw002136 for ; Tue, 2 Feb 2010 19:11:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932281Ab0BBTJE (ORCPT ); Tue, 2 Feb 2010 14:09:04 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:43312 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab0BBTJC (ORCPT ); Tue, 2 Feb 2010 14:09:02 -0500 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0016.houston.hp.com (Postfix) with ESMTP id 3EE9614589; Tue, 2 Feb 2010 19:09:01 +0000 (UTC) Received: from ldl (ldl.fc.hp.com [15.11.146.30]) by g4t0009.houston.hp.com (Postfix) with ESMTP id 2A76EC02E; Tue, 2 Feb 2010 19:09:01 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 17396CF000A; Tue, 2 Feb 2010 12:09:01 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GLGA38+C+45L; Tue, 2 Feb 2010 12:09:01 -0700 (MST) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 03F9ACF0007; Tue, 2 Feb 2010 12:09:01 -0700 (MST) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id E6730261D3; Tue, 2 Feb 2010 12:09:00 -0700 (MST) Subject: [PATCH v2 15/18] IB/ucm: use stack variable 'base' in ib_ucm_add_one To: rdreier@cisco.com From: Alex Chiang Cc: linux-rdma@vger.kernel.org, justin.chen@hp.com, linux-kernel@vger.kernel.org Date: Tue, 02 Feb 2010 12:09:00 -0700 Message-ID: <20100202190900.28217.53919.stgit@bob.kio> In-Reply-To: <20100202185235.28217.64521.stgit@bob.kio> References: <20100202185235.28217.64521.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 02 Feb 2010 19:11:59 +0000 (UTC) diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index 7ff3300..06c50d8 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c @@ -1240,6 +1240,7 @@ static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL); static void ib_ucm_add_one(struct ib_device *device) { int devnum; + dev_t base; struct ib_ucm_device *ucm_dev; if (!device->alloc_ucontext || @@ -1257,12 +1258,13 @@ static void ib_ucm_add_one(struct ib_device *device) goto err; ucm_dev->devnum = devnum; + base = devnum + IB_UCM_BASE_DEV; set_bit(devnum, dev_map); cdev_init(&ucm_dev->cdev, &ucm_fops); ucm_dev->cdev.owner = THIS_MODULE; kobject_set_name(&ucm_dev->cdev.kobj, "ucm%d", ucm_dev->devnum); - if (cdev_add(&ucm_dev->cdev, IB_UCM_BASE_DEV + devnum, 1)) + if (cdev_add(&ucm_dev->cdev, base, 1)) goto err; ucm_dev->dev.class = &cm_class;