diff options
author | Linus Torvalds | 2024-03-21 09:27:37 -0700 |
---|---|---|
committer | Linus Torvalds | 2024-03-21 09:27:37 -0700 |
commit | 879e288692c899d52fcc01ae73121a771ea10d18 (patch) | |
tree | 43502002600d8cca7529f240cf12793ea76b4a80 /include | |
parent | 23956900041d968f9ad0f30db6dede4daccd7aa9 (diff) | |
parent | fd8ed16c2419e23b7496e008e5f7be98da7fe2d5 (diff) |
Merge tag 'bitmap-for-6.9' of https://github.com/norov/linux
Pull bitmap updates from Yury Norov:
"A couple of random cleanups plus a step-down patch from Andy"
* tag 'bitmap-for-6.9' of https://github.com/norov/linux:
bitmap: Step down as a reviewer
lib/find: optimize find_*_bit_wrap
lib/find_bit: Fix the code comments about find_next_bit_wrap
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/find.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/find.h b/include/linux/find.h index 5e4f39ef2e72..c69598e383c1 100644 --- a/include/linux/find.h +++ b/include/linux/find.h @@ -405,7 +405,7 @@ unsigned long find_next_and_bit_wrap(const unsigned long *addr1, { unsigned long bit = find_next_and_bit(addr1, addr2, size, offset); - if (bit < size) + if (bit < size || offset == 0) return bit; bit = find_first_and_bit(addr1, addr2, offset); @@ -413,8 +413,8 @@ unsigned long find_next_and_bit_wrap(const unsigned long *addr1, } /** - * find_next_bit_wrap - find the next set bit in both memory regions - * @addr: The first address to base the search on + * find_next_bit_wrap - find the next set bit in a memory region + * @addr: The address to base the search on * @size: The bitmap size in bits * @offset: The bitnumber to start searching at * @@ -427,7 +427,7 @@ unsigned long find_next_bit_wrap(const unsigned long *addr, { unsigned long bit = find_next_bit(addr, size, offset); - if (bit < size) + if (bit < size || offset == 0) return bit; bit = find_first_bit(addr, offset); |