Commit 9276819a authored by Yury Norov's avatar Yury Norov
Browse files

bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit()



_reg_op(REG_OP_ISFREE) can be trivially replaced with find_next_bit().
Doing that opens room for potential small_const_nbits() optimization.

CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
parent add00c76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -840,7 +840,7 @@ int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)
{
	unsigned int len = BIT(order);

	if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
	if (find_next_bit(bitmap, pos + len, pos) < pos + len)
		return -EBUSY;
	bitmap_set(bitmap, pos, len);
	return 0;