1 // SPDX-License-Identifier: GPL-2.0+
2 #ifndef __LINUX_BITMAP_H
3 #define __LINUX_BITMAP_H
6 #include <linux/types.h>
7 #include <linux/bitops.h>
9 #define small_const_nbits(nbits) \
10 (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
12 static inline void bitmap_zero(unsigned long *dst, int nbits)
14 if (small_const_nbits(nbits)) {
17 int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
23 #endif /* __LINUX_BITMAP_H */