u64 align_mask = ~(alignment - 1);
if ((alignment & 3) || (alignment > 0x800000000000ULL) ||
- ((hweight32(alignment >> 32) +
- hweight32(alignment & 0xffffffff) != 1))) {
+ (hweight64(alignment) != 1)) {
HPSB_ERR("%s called with invalid alignment: 0x%048llx",
__FUNCTION__, (unsigned long long)alignment);
return retval;
}
EXPORT_SYMBOL(__bitmap_subset);
-#if BITS_PER_LONG == 32
int __bitmap_weight(const unsigned long *bitmap, int bits)
{
int k, w = 0, lim = bits/BITS_PER_LONG;
for (k = 0; k < lim; k++)
- w += hweight32(bitmap[k]);
+ w += hweight_long(bitmap[k]);
if (bits % BITS_PER_LONG)
- w += hweight32(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
+ w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
return w;
}
-#else
-int __bitmap_weight(const unsigned long *bitmap, int bits)
-{
- int k, w = 0, lim = bits/BITS_PER_LONG;
-
- for (k = 0; k < lim; k++)
- w += hweight64(bitmap[k]);
-
- if (bits % BITS_PER_LONG)
- w += hweight64(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
-
- return w;
-}
-#endif
EXPORT_SYMBOL(__bitmap_weight);
/*