summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2023-09-25 04:38:13 +0200
committerYury Norov <yury.norov@gmail.com>2023-10-15 05:25:22 +0200
commiteae5acbd7572f2874cd2f04dd540870dca256826 (patch)
treea874238174b8f0d9ff355094e8b96b43d7c30dc2 /lib
parentbitmap: fix opencoded bitmap_allocate_region() (diff)
downloadlinux-eae5acbd7572f2874cd2f04dd540870dca256826.tar.xz
linux-eae5acbd7572f2874cd2f04dd540870dca256826.zip
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')
-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);