* [PATCH] lib/bitmap: drop unneeded small_const_nbits() calls
@ 2021-11-03 16:30 Yury Norov
0 siblings, 0 replies; only message in thread
From: Yury Norov @ 2021-11-03 16:30 UTC (permalink / raw)
To: linux-kernel, Yury Norov, Andy Shevchenko, Rasmus Villemoes
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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-03 16:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 16:30 [PATCH] lib/bitmap: drop unneeded small_const_nbits() calls Yury Norov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).