diff options
| author | Yury Norov <[email protected]> | 2023-09-25 02:38:13 +0000 |
|---|---|---|
| committer | Yury Norov <[email protected]> | 2023-10-15 03:25:22 +0000 |
| commit | eae5acbd7572f2874cd2f04dd540870dca256826 (patch) | |
| tree | a874238174b8f0d9ff355094e8b96b43d7c30dc2 /lib/bitmap.c | |
| parent | bitmap: fix opencoded bitmap_allocate_region() (diff) | |
| download | kernel-eae5acbd7572f2874cd2f04dd540870dca256826.tar.gz kernel-eae5acbd7572f2874cd2f04dd540870dca256826.zip | |
bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()
_reg_op(REG_OP_ALLOC) duplicates bitmap_set().
CC: Andy Shevchenko <[email protected]>
CC: Rasmus Villemoes <[email protected]>
Signed-off-by: Yury Norov <[email protected]>
Diffstat (limited to 'lib/bitmap.c')
| -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); |
