mirror of
https://github.com/versity/scoutfs.git
synced 2025-12-23 05:25:18 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user