]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()
authorYury Norov <yury.norov@gmail.com>
Mon, 25 Sep 2023 02:38:13 +0000 (19:38 -0700)
committerYury Norov <yury.norov@gmail.com>
Sun, 15 Oct 2023 03:25:22 +0000 (20:25 -0700)
_reg_op(REG_OP_ALLOC) duplicates bitmap_set().

CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
lib/bitmap.c

index a0b02974d898f241a72d9fa0941529854a1d7b04..8ee7d4857179d5f29c31cae476cea6cb257c263d 100644 (file)
@@ -838,9 +838,12 @@ EXPORT_SYMBOL(bitmap_release_region);
  */
 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))
                return -EBUSY;
-       return __reg_op(bitmap, pos, order, REG_OP_ALLOC);
+       bitmap_set(bitmap, pos, len);
+       return 0;
 }
 EXPORT_SYMBOL(bitmap_allocate_region);