Re: [PATCH] use idr_get_new to allocate a bus id in drivers/i2c/i2c-core.c

From: Greg KH
Date: Wed May 19 2004 - 02:11:20 EST


On Sun, May 16, 2004 at 12:13:13PM +0300, Faik Uygur wrote:
> On Sat, 15 May 2004, Andrew Morton wrote:
>
> > The IDR interface is a bit cumbersome. Even though you called
> > idr_pre_get(), there's no guarantee that the memory which it preallocated
> > is still present when you call idr_get_new().
>
> Thanks for the correction.
>
> > Is the kernel likely to ever have so many bus IDs that we actually need
> > this patch? Or do you specifically want first-fit-from-zero for some
> > reason?
>
> Actually there is no special need for this. It is just what i think would
> be the expected behaviour. There was a thread two weeks ago about this issue:
>
> http://marc.theaimsgroup.com/?l=linux-kernel&m=108370586601550&w=2
>
> here is the updated patch:

Nice, thanks, I've applied this to my trees. I tried doing this same
patch a while ago, but missed the masking off the upper bits trick, and
was wondering why my results were so strange...

thanks again,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/