Messages in this thread | | | Date | Sun, 3 Feb 2013 12:18:09 +0100 | From | Stefan Richter <> | Subject | Re: [PATCH 13/62] firewire: convert to idr_alloc() |
| |
On Feb 03 Stefan Richter wrote: > On Feb 02 Tejun Heo wrote: > > --- a/drivers/firewire/core-device.c > > +++ b/drivers/firewire/core-device.c > > @@ -1017,13 +1017,12 @@ static void fw_device_init(struct work_struct *work) > > > > fw_device_get(device); > > down_write(&fw_device_rwsem); > > - ret = idr_pre_get(&fw_device_idr, GFP_KERNEL) ? > > - idr_get_new(&fw_device_idr, device, &minor) : > > - -ENOMEM; > > + ret = idr_alloc(&fw_device_idr, device, 0, 0, GFP_KERNEL); > > up_write(&fw_device_rwsem); > > > > if (ret < 0) > > goto error; > > + minor = ret; > > > > device->device.bus = &fw_bus_type; > > device->device.type = &fw_device_type; > > This hunk is OK, of course.
Could be changed into
ret = idr_alloc(&fw_device_idr, device, 0, 1 << MINORBITS, GFP_KERNEL);
though, which would be an additional bug fix. -- Stefan Richter -=====-===-= --=- ---== http://arcgraph.de/sr/
| |