lkml.org 
[lkml]   [2013]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/


\
 
 \ /
  Last update: 2013-02-03 13:01    [W:0.091 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site