I was browsing the Linux kernel code and in the file hid.h, the HID_QUIRK_ALWAYS_POLL macro is defined as:
#define HID_QUIRK_ALWAYS_POLL BIT(10)
What is the meaning of BIT(10)? I am not really familiar with C but from what I know (and researched) there is no such bit manipulation function.
looks like you can find the answer inside the first header file included, i.e. bitops.h!
#define BIT(nr) (1UL << (nr))
i.e. BIT defines a bit mask for the specified bit number from 0 (least significant, or rightmost bit) to whatever fits into an unsigned long.
So BIT(10) should evaluate to the numeric value of 1024 (which is 1 << 10).
BIT is a macro defined in include/linux/bitops.h in the kernel tree:
#define BIT(nr) (1UL << (nr))
So BIT(10) is basically an unsigned long with tenth bit set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With