Re: [PATCH v9 1/2] lib/bitmap: add bitmap_{read,write}()

From: Andy Shevchenko
Date: Thu Oct 26 2023 - 09:34:37 EST


On Thu, Oct 26, 2023 at 03:28:25PM +0200, Alexander Potapenko wrote:

...

> > I still didn't get the grouping you implied with this...
>
> Given your second reply, I can disregard this one, right?

Yes.

...

> > > + if (unlikely(!nbits || nbits > BITS_PER_LONG))
> > > + return 0;
> >
> > ...this return in the Return section.
> >
>
> Parameter description for @nbits actually mentions BITS_PER_LONG
> already, so would it be ok to drop the Note: and extend the Returns:
> section as follows:
>
> + * Returns: value of nbits located at the @start bit offset within the @map
> + * memory region. For @nbits = 0 and @nbits > BITS_PER_LONG the return value
> + * is undefined.
>
> ?

Fine to me.

> (Yury didn't want the zero return value to be part of the contract here).


--
With Best Regards,
Andy Shevchenko