Re: [PATCH v2 2/6] bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()

From: Andy Shevchenko
Date: Fri Aug 11 2023 - 05:25:08 EST


On Thu, Aug 10, 2023 at 05:57:28PM -0700, Yury Norov wrote:
> _reg_op(REG_OP_ALLOC) duplicates bitmap_set(). Fix it.

...

> int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)
> {
> + unsigned int nbits = pos + BIT(order);

Shouldn't this be unsigned long?
As the prototype of the used later unsigned long find_next_bit().

> if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
> return -EBUSY;
> - return __reg_op(bitmap, pos, order, REG_OP_ALLOC);
> + bitmap_set(bitmap, pos, nbits);
> + return 0;
> }

--
With Best Regards,
Andy Shevchenko