Merge tag 'bitmap-for-6.9' of https://github.com/norov/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Mar 2024 16:27:37 +0000 (09:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Mar 2024 16:27:37 +0000 (09:27 -0700)
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

MAINTAINERS
include/linux/find.h

index 43b39956694ae69c29dc2acee65d99935d14ec1d..6ce2ccc5668a84294690eb9da1c047dc9d83f1a2 100644 (file)
@@ -3598,7 +3598,6 @@ F:        include/uapi/linux/bfs_fs.h
 
 BITMAP API
 M:     Yury Norov <yury.norov@gmail.com>
-R:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
 R:     Rasmus Villemoes <linux@rasmusvillemoes.dk>
 S:     Maintained
 F:     include/linux/bitfield.h
index 5e4f39ef2e72cc00b5924f048d60394e6e579313..c69598e383c1618fbbdd99e252f70c2cacfd72df 100644 (file)
@@ -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);