Messages in this thread Patch in this message | | | From | Yury Norov <> | Subject | [PATCH 2/6] bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set() | Date | Thu, 27 Oct 2022 18:48:30 -0700 |
| |
_reg_op(REG_OP_ALLOC) duplicates bitmap_set(). Drop it.
Signed-off-by: Yury Norov <yury.norov@gmail.com> --- lib/bitmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/bitmap.c b/lib/bitmap.c index 1c81413c51f8..28630b57b2ab 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -1317,7 +1317,7 @@ int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order) for (pos = 0 ; (end = pos + (1U << order)) <= bits; pos = end) { if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE)) continue; - __reg_op(bitmap, pos, order, REG_OP_ALLOC); + bitmap_set(bitmap, pos, pos + BIT(order)); return pos; } return -ENOMEM; @@ -1356,7 +1356,8 @@ int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int 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, pos + BIT(order)); + return 0; } EXPORT_SYMBOL(bitmap_allocate_region); -- 2.34.1
| |