bitops for handling 32 bits

Kevin Wilson wkevils at
Tue Jul 28 10:46:31 EDT 2015

Hi all,
Is there a kernel API for handling 32 bits ?
I see a macro like BIT(nr)

#define BIT(nr)                 (1UL << (nr))

and also
#define BIT_ULL(nr)             (1ULL << (nr))

However, these macros are using 64 bit semantics, so if I will use
them with 32 bits values
the results will  be wrong.

Any ideas ?


More information about the Kernelnewbies mailing list