Skip to contentSkip to conversation

lib/bitmap: drop unneeded small_const_nbits() calls

PATCH New Yury Norov 1 participant 1 message Nov 3, 2021 Bitmap API

lore
Share & tools
lore

Yury Norov

author maintainer
#0 lore raw

PATCH 1/1 lib/bitmap: drop unneeded small_const_nbits() calls

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

---
 include/linux/bitmap.h | 6 ------
 1 file changed, 6 deletions(-)
include/linux/bitmap.h +0 -6
index 7dba0847510c..f4b47cc185fa 100644
@@ -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;
 }
 
Signature · 1 line
2.30.2