diff options
| author | Yury Norov <[email protected]> | 2023-09-25 02:38:15 +0000 |
|---|---|---|
| committer | Yury Norov <[email protected]> | 2023-10-15 03:25:22 +0000 |
| commit | 9276819a68b52cf2577f77985041faf527cf477c (patch) | |
| tree | 32b47f510cc4c21acfd629749063a3cd518887c6 /lib/bitmap.c | |
| parent | bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear() (diff) | |
| download | kernel-9276819a68b52cf2577f77985041faf527cf477c.tar.gz kernel-9276819a68b52cf2577f77985041faf527cf477c.zip | |
bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit()
_reg_op(REG_OP_ISFREE) can be trivially replaced with find_next_bit().
Doing that opens room for potential small_const_nbits() optimization.
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 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index babed4dcb467..e4d761a69fe8 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -840,7 +840,7 @@ 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)) + if (find_next_bit(bitmap, pos + len, pos) < pos + len) return -EBUSY; bitmap_set(bitmap, pos, len); return 0; |
