mirror of
https://xff.cz/git/u-boot/
synced 2025-09-20 18:12:11 +02:00
linux/bitmap.h: add bitmap_empty helper
Import this function from Linux as of 6.10-rc6 Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
This commit is contained in:
@@ -196,6 +196,14 @@ static inline void bitmap_fill(unsigned long *dst, unsigned int nbits)
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool bitmap_empty(const unsigned long *src, unsigned int nbits)
|
||||
{
|
||||
if (small_const_nbits(nbits))
|
||||
return !(*src & BITMAP_LAST_WORD_MASK(nbits));
|
||||
|
||||
return find_first_bit(src, nbits) == nbits;
|
||||
}
|
||||
|
||||
static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
|
||||
const unsigned long *src2, unsigned int nbits)
|
||||
{
|
||||
|
Reference in New Issue
Block a user