Re: [PATCH v1 2/6] amso1100: convert to using idr_alloc_cyclic

From: Jeff Layton
Date: Wed Mar 27 2013 - 12:50:38 EST


On Wed, 27 Mar 2013 09:27:55 -0700
Tejun Heo <tj@xxxxxxxxxx> wrote:

> On Wed, Mar 27, 2013 at 09:18:04AM -0400, Jeff Layton wrote:
> > void c2_init_qp_table(struct c2_dev *c2dev)
> > {
> > spin_lock_init(&c2dev->qp_table.lock);
> > - idr_init(&c2dev->qp_table.idr);
> > + idr_init_cyclic(&c2dev->qp_table.idr, 0);
> > }
>
> Why is this necessary? In general, why is idr_init_cyclic()
> necessary?
>
> Thanks.
>

My thinking was that you might want to initialize the "cur" value to an
arbitrary value. All the current users though initialize it to the same
as the "start" value passed into idr_alloc_cyclic. Starting with it at
0 should be fine in all of the existing users.

I'll remove that in v2...

Thanks!
--
Jeff Layton <jlayton@xxxxxxxxxx>
--
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/