summaryrefslogtreecommitdiff
path: root/lib/bitmap.c
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2023-09-24 19:38:13 -0700
committerYury Norov <yury.norov@gmail.com>2023-10-14 20:25:22 -0700
commiteae5acbd7572f2874cd2f04dd540870dca256826 (patch)
treea874238174b8f0d9ff355094e8b96b43d7c30dc2 /lib/bitmap.c
parentb085f969ed3df1916b9d9029225f2472df33cc17 (diff)
bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()
_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>
Diffstat (limited to 'lib/bitmap.c')
-rw-r--r--lib/bitmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index a0b02974d898..8ee7d4857179 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -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);