History

linux/types.h: reinstate "__bitwise__" macro for user space use

Commit c724c866bb70 ("linux/types.h: remove unnecessary __bitwise__") was right that there are no users of __bitwise__ in the kernel, but it turns out there are user space users of it that do expect it. It is, after all, in the uapi directory, so user space usage is to be expected. Instead of reverting the commit completely, let's just clarify the situation so that it doesn't happen again, and have some in-code explanations for why that "__bitwise__" still exists.

Linus Torvalds committed 4 years ago

Commit caa28981 parent e5499dd1 file · +3 −0Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/types.h+3−0
@@ -26,6 +26,9 @@ · 25 unmodified lines
2626 #define __bitwise
2727 #endif
2828
29+/* The kernel doesn't use this legacy form, but user space does */
30+#define __bitwise__ __bitwise
31+
2932 typedef __u16 __bitwise __le16;
3033 typedef __u16 __bitwise __be16;
3134 typedef __u32 __bitwise __le32;