diff options
author | Tom Rini <trini@konsulko.com> | 2022-02-08 12:28:04 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-02-08 12:28:04 -0500 |
commit | 531c00894577a0a852431adf61ade76925f8b162 (patch) | |
tree | 37cde6437d2f64f49d5eec47cfccd36bb92d4146 /include/linux/bitmap.h | |
parent | 8b139f4e1c08c4ffb1a8e739db128ed02cbc637f (diff) | |
parent | f55d4978e130bbe488f031bcad2763ea90c372bd (diff) |
Merge branch '2022-02-08-TI-platform-updates'
- J721S2 support, IPU support on DRA7, SIERRA PHY mulitlink
configuration support, Nokia RX-51 DM_KEYBOARD conversion
Diffstat (limited to 'include/linux/bitmap.h')
-rw-r--r-- | include/linux/bitmap.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index dae4225be54..0a8503af9f1 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -159,6 +159,32 @@ static inline unsigned long find_first_bit(const unsigned long *addr, unsigned l (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) +static inline unsigned long +bitmap_find_next_zero_area(unsigned long *map, + unsigned long size, + unsigned long start, + unsigned int nr, unsigned long align_mask) +{ + unsigned long index, end, i; +again: + index = find_next_zero_bit(map, size, start); + + /* + * Align allocation + */ + index = (index + align_mask) & ~align_mask; + + end = index + nr; + if (end > size) + return end; + i = find_next_bit(map, end, index); + if (i < end) { + start = i + 1; + goto again; + } + return index; +} + static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) { if (small_const_nbits(nbits)) { |