Fix set_bit_le() type width problems

The swizzle value was defined in terms of longs but the code used u64s.
And the bare shifted value was an int so it'd get truncated.  Switch it
all to using longs.

The ratio of bugs to lines of code in that first attempt was through the
roof!

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-03-23 22:21:11 -04:00
parent 502783e1bc
commit ddf5ef1017

View File

@@ -10,11 +10,11 @@
static inline void set_bit_le(int nr, void *addr)
{
u64 *dwords = addr;
unsigned long *longs = addr;
nr ^= BITOP_LE_SWIZZLE;
dwords[nr / 64] |= 1 << (nr & 63);
longs[nr / BITS_PER_LONG] |= 1UL << (nr & (BITS_PER_LONG - 1));
}
#endif