Skip to content

Commit b085f96

Browse files
committed
bitmap: fix opencoded bitmap_allocate_region()
bitmap_find_region() opencodes bitmap_allocate_region(). CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com> CC: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Yury Norov <yury.norov@gmail.com>
1 parent 6d5d3a0 commit b085f96

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/bitmap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,8 @@ int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order)
803803
unsigned int pos, end; /* scans bitmap by regions of size order */
804804

805805
for (pos = 0; (end = pos + BIT(order)) <= bits; pos = end) {
806-
if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
807-
continue;
808-
__reg_op(bitmap, pos, order, REG_OP_ALLOC);
809-
return pos;
806+
if (!bitmap_allocate_region(bitmap, pos, order))
807+
return pos;
810808
}
811809
return -ENOMEM;
812810
}

0 commit comments

Comments
 (0)