Skip to content

Commit 879e288

Browse files
committed
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
2 parents 2395690 + fd8ed16 commit 879e288

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3598,7 +3598,6 @@ F: include/uapi/linux/bfs_fs.h
35983598

35993599
BITMAP API
36003600
M: Yury Norov <yury.norov@gmail.com>
3601-
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
36023601
R: Rasmus Villemoes <linux@rasmusvillemoes.dk>
36033602
S: Maintained
36043603
F: include/linux/bitfield.h

include/linux/find.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,16 @@ unsigned long find_next_and_bit_wrap(const unsigned long *addr1,
405405
{
406406
unsigned long bit = find_next_and_bit(addr1, addr2, size, offset);
407407

408-
if (bit < size)
408+
if (bit < size || offset == 0)
409409
return bit;
410410

411411
bit = find_first_and_bit(addr1, addr2, offset);
412412
return bit < offset ? bit : size;
413413
}
414414

415415
/**
416-
* find_next_bit_wrap - find the next set bit in both memory regions
417-
* @addr: The first address to base the search on
416+
* find_next_bit_wrap - find the next set bit in a memory region
417+
* @addr: The address to base the search on
418418
* @size: The bitmap size in bits
419419
* @offset: The bitnumber to start searching at
420420
*
@@ -427,7 +427,7 @@ unsigned long find_next_bit_wrap(const unsigned long *addr,
427427
{
428428
unsigned long bit = find_next_bit(addr, size, offset);
429429

430-
if (bit < size)
430+
if (bit < size || offset == 0)
431431
return bit;
432432

433433
bit = find_first_bit(addr, offset);

0 commit comments

Comments
 (0)