On Mon, 18 Mar 2024 15:12:20 +0200 Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > On Mon, Mar 18, 2024 at 2:33 PM Jonathan Cameron > <Jonathan.Cameron@xxxxxxxxxx> wrote: > > On Sat, 16 Mar 2024 21:32:56 +0200 > > Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > > > Thu, Feb 29, 2024 at 04:10:26PM +0100, Nuno Sa kirjoitti: > > ... > > > > > - ret = bitmap_find_free_region(trig->pool, > > > > - CONFIG_IIO_CONSUMERS_PER_TRIGGER, > > > > - ilog2(1)); > > > > > > > + ret = bitmap_find_free_region(trig->pool, > > > > + CONFIG_IIO_CONSUMERS_PER_TRIGGER, > > > > + ilog2(1)); > > > > > > Despite being in the original code, this is funny magic constant... > > > > Not that magic, build time config variable to avoid adding complexity > > of dynamic expansion of various structures. We could have picked a big > > number but someone will always want a bigger one and from what I recall > > actually make it expandable was nasty to do. Been a long time, though > > so I'm open to patches that get rid of this in favor of a dynamic solution. > > I didn't get you, sorry. Logarithm (by any base) from 1 is 0. Writing > it as arithmetic expression seems funny to me. Ah. I was looking at the line above ;) That one is because it lines up with the docs for bitmap_find_free_region() Last parameter is order, but seems more natural to express it in number of bits hence the 1 rather that superficially looking like we are asking for a region of length 0. >