diff options
author | Yury Norov <yury.norov@gmail.com> | 2023-09-25 05:38:13 +0300 |
---|---|---|
committer | Yury Norov <yury.norov@gmail.com> | 2023-10-15 06:25:22 +0300 |
commit | eae5acbd7572f2874cd2f04dd540870dca256826 (patch) | |
tree | a874238174b8f0d9ff355094e8b96b43d7c30dc2 /lib | |
parent | b085f969ed3df1916b9d9029225f2472df33cc17 (diff) | |
download | linux-eae5acbd7572f2874cd2f04dd540870dca256826.tar.xz |
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.c | 5 |
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); |