Use an explicitly long constant 1UL identical to the type of the
variable holding the bit mask. This avoids using the same bit twice,
because on 64 bit architectures, 1 << 32 == 0.
Found by Dotan Barak at Mellanox.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
/* nothing */;
j = ffsl(page->free[i]);
- page->free[i] &= ~(1 << (j - 1));
+ page->free[i] &= ~(1UL << (j - 1));
db = page->buf.buf + (i * 8 * sizeof (long) + (j - 1)) * db_size[type];
out:
goto out;
i = ((void *) db - page->buf.buf) / db_size[type];
- page->free[i / (8 * sizeof (long))] |= 1 << (i % (8 * sizeof (long)));
+ page->free[i / (8 * sizeof (long))] |= 1UL << (i % (8 * sizeof (long)));
if (!--page->use_cnt) {
if (page->prev)