[prev in list] [next in list] [prev in thread] [next in thread]
List: linux1394-devel
Subject: Re: [PATCH 13/62] firewire: convert to idr_alloc()
From: Stefan Richter <stefanr () s5r6 ! in-berlin ! de>
Date: 2013-02-03 11:18:09
Message-ID: 20130203121809.2fb21a0c () stein
[Download RAW message or body]
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/
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
mailing list linux1394-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux1394-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic