|
@@ -172,12 +172,8 @@ extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int
|
|
extern int bitmap_print_to_pagebuf(bool list, char *buf,
|
|
extern int bitmap_print_to_pagebuf(bool list, char *buf,
|
|
const unsigned long *maskp, int nmaskbits);
|
|
const unsigned long *maskp, int nmaskbits);
|
|
|
|
|
|
-#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG))
|
|
|
|
-#define BITMAP_LAST_WORD_MASK(nbits) \
|
|
|
|
-( \
|
|
|
|
- ((nbits) % BITS_PER_LONG) ? \
|
|
|
|
- (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \
|
|
|
|
-)
|
|
|
|
|
|
+#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
|
|
|
|
+#define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1)))
|
|
|
|
|
|
#define small_const_nbits(nbits) \
|
|
#define small_const_nbits(nbits) \
|
|
(__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
|
|
(__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
|