Skip to contentSkip to conversation

Revert "linux/types.h: remove unnecessary __bitwise__"

PATCH In review Bjorn Helgaas 3 participants 3 messages May 25, 2022 – May 26, 2022 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "linux/types.h: remove unnecessary __bitwise__"

From: Bjorn Helgaas <[email protected]>

This reverts commit c724c866bb70cb8c607081a26823a1f0ebde4387.

Jiri Slaby reported that c724c866bb70 ("linux/types.h: remove unnecessary __bitwise__") broke userspace, including open-iscsi, because it uses __bitwise__.

Restore the __bitwise__ definition.

---
 include/uapi/linux/types.h  | 5 +++--
 tools/include/linux/types.h | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
include/uapi/linux/types.h +3 -2
index c4dc597f3dcf..2415d5dcb5d3 100644
@@ -21,10 +21,11 @@
 
 /* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
 #ifdef __CHECKER__
-#define __bitwise	__attribute__((bitwise))
+#define __bitwise__ __attribute__((bitwise))
 #else
-#define __bitwise
+#define __bitwise__
 #endif
+#define __bitwise __bitwise__
 
 typedef __u16 __bitwise __le16;
 typedef __u16 __bitwise __be16;
tools/include/linux/types.h +3 -2
index 051fdeaf2670..5908e58c3598 100644
@@ -43,10 +43,11 @@ typedef __u8  u8;
 typedef __s8  s8;
 
 #ifdef __CHECKER__
-#define __bitwise	__attribute__((bitwise))
+#define __bitwise__ __attribute__((bitwise))
 #else
-#define __bitwise
+#define __bitwise__
 #endif
+#define __bitwise __bitwise__
 
 #define __force
 #define __user
Signature · 1 line
2.25.1
#1 lore raw
Quoted 8 lines · Bjorn Helgaas

This reverts commit c724c866bb70cb8c607081a26823a1f0ebde4387.

Jiri Slaby reported that c724c866bb70 ("linux/types.h: remove unnecessary __bitwise__") broke userspace, including open-iscsi, because it uses __bitwise__.

Restore the __bitwise__ definition.

Hmm.

Presumably it's only the uapi case that actually wants to re-instate it.

And I'd rather make that "__bitwise__" case explicitly special, with a comment about why it exists when the kernel itself doesn't use it.

IOW, rather than the revert, maybe something like the below (whitespace-damaged) instead?

Jiri, does something like this work for you?

Linus

---
 include/uapi/linux/types.h | 3 +++
 1 file changed, 3 insertions(+)
include/uapi/linux/types.h +3 -0
index c4dc597f3dcf..308433be33c2 100644
@@ -26,6 +26,9 @@
 #define __bitwise
 #endif
 
+/* The kernel doesn't use this legacy form, but user space does */
+#define __bitwise__ __bitwise
+
 typedef __u16 __bitwise __le16;
 typedef __u16 __bitwise __be16;
 typedef __u32 __bitwise __le32;
#2 lore raw
Quoted 14 lines · Linus Torvalds
Quoted 8 lines · Bjorn Helgaas

This reverts commit c724c866bb70cb8c607081a26823a1f0ebde4387.

Jiri Slaby reported that c724c866bb70 ("linux/types.h: remove unnecessary __bitwise__") broke userspace, including open-iscsi, because it uses __bitwise__.

Restore the __bitwise__ definition.

Hmm.

Presumably it's only the uapi case that actually wants to re-instate it.

Quoted 7 lines

And I'd rather make that "__bitwise__" case explicitly special, with a comment about why it exists when the kernel itself doesn't use it.

IOW, rather than the revert, maybe something like the below (whitespace-damaged) instead?

Jiri, does something like this work for you?

Yes, thanks.

Quoted 18 lines
---
  include/uapi/linux/types.h | 3 +++
  1 file changed, 3 insertions(+)
include/uapi/linux/types.h +3 -0
index c4dc597f3dcf..308433be33c2 100644
@@ -26,6 +26,9 @@
  #define __bitwise
  #endif
 
+/* The kernel doesn't use this legacy form, but user space does */
+#define __bitwise__ __bitwise
+
  typedef __u16 __bitwise __le16;
  typedef __u16 __bitwise __be16;
  typedef __u32 __bitwise __le32;
Signature · 2 lines
js
suse labs