[PATCH] lib/bitmap: drop unneeded small_const_nbits() calls

From: Yury Norov
Date: Wed Nov 03 2021 - 12:30:23 EST


Since recently, find_bit() functions have their own optimizations for a
small_const_nbits() case. Therefore drop this check in relevant bitmap
functions.

Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
---
include/linux/bitmap.h | 6 ------
1 file changed, 6 deletions(-)

diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 7dba0847510c..f4b47cc185fa 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -382,17 +382,11 @@ static inline int bitmap_subset(const unsigned long *src1,

static inline bool bitmap_empty(const unsigned long *src, unsigned nbits)
{
- if (small_const_nbits(nbits))
- return ! (*src & BITMAP_LAST_WORD_MASK(nbits));
-
return find_first_bit(src, nbits) == nbits;
}

static inline bool bitmap_full(const unsigned long *src, unsigned int nbits)
{
- if (small_const_nbits(nbits))
- return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits));
-
return find_first_zero_bit(src, nbits) == nbits;
}

--
2.30.2