utils: Fix BIT() signedness

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-11-01 18:58:01 +09:00
parent 425daaedbd
commit 326ba6fb33

View file

@ -15,7 +15,7 @@
} while (0) } while (0)
#endif #endif
#define BIT(x) (1L << (x)) #define BIT(x) (1UL << (x))
#define MASK(x) (BIT(x) - 1) #define MASK(x) (BIT(x) - 1)
#define GENMASK(msb, lsb) ((BIT((msb + 1) - (lsb)) - 1) << (lsb)) #define GENMASK(msb, lsb) ((BIT((msb + 1) - (lsb)) - 1) << (lsb))
#define _FIELD_LSB(field) ((field) & ~(field - 1)) #define _FIELD_LSB(field) ((field) & ~(field - 1))