aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorAlexander Chiang <achiang@hp.com>2010-02-02 14:09:00 -0500
committerRoland Dreier <rolandd@cisco.com>2010-02-24 13:23:47 -0500
commit31d14b6e10657113f72d496121d52ca779156b2e (patch)
tree72bd20cc099892eb5941cae11f02a6a5011c2997 /drivers/infiniband
parentdd08f702dd773004b81aeddcd120b052a42710c3 (diff)
IB/ucm: Use stack variable 'base' in ib_ucm_add_one
This change is not useful by itself, but sets us up for a future change that allows us to support more than IB_UCM_MAX_DEVICES. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/ucm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 7ff3300a86ca..06c50d80f0d8 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);
1240static void ib_ucm_add_one(struct ib_device *device) 1240static void ib_ucm_add_one(struct ib_device *device)
1241{ 1241{
1242 int devnum; 1242 int devnum;
1243 dev_t base;
1243 struct ib_ucm_device *ucm_dev; 1244 struct ib_ucm_device *ucm_dev;
1244 1245
1245 if (!device->alloc_ucontext || 1246 if (!device->alloc_ucontext ||
@@ -1257,12 +1258,13 @@ static void ib_ucm_add_one(struct ib_device *device)
1257 goto err; 1258 goto err;
1258 1259
1259 ucm_dev->devnum = devnum; 1260 ucm_dev->devnum = devnum;
1261 base = devnum + IB_UCM_BASE_DEV;
1260 set_bit(devnum, dev_map); 1262 set_bit(devnum, dev_map);
1261 1263
1262 cdev_init(&ucm_dev->cdev, &ucm_fops); 1264 cdev_init(&ucm_dev->cdev, &ucm_fops);
1263 ucm_dev->cdev.owner = THIS_MODULE; 1265 ucm_dev->cdev.owner = THIS_MODULE;
1264 kobject_set_name(&ucm_dev->cdev.kobj, "ucm%d", ucm_dev->devnum); 1266 kobject_set_name(&ucm_dev->cdev.kobj, "ucm%d", ucm_dev->devnum);
1265 if (cdev_add(&ucm_dev->cdev, IB_UCM_BASE_DEV + devnum, 1)) 1267 if (cdev_add(&ucm_dev->cdev, base, 1))
1266 goto err; 1268 goto err;
1267 1269
1268 ucm_dev->dev.class = &cm_class; 1270 ucm_dev->dev.class = &cm_class;