* [PATCH] Revert "linux/types.h: remove unnecessary __bitwise__"
@ 2022-05-25 14:46 Bjorn Helgaas
2022-05-25 16:02 ` Linus Torvalds
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2022-05-25 14:46 UTC (permalink / raw)
To: Andrew Morton, Jonathan Corbet, Linus Torvalds
Cc: Nathan Chancellor, Nick Desaulniers, Michael S . Tsirkin,
Jiri Slaby, llvm, linux-doc, linux-kernel, Bjorn Helgaas
From: Bjorn Helgaas <bhelgaas@google.com>
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.
Link: https://lore.kernel.org/r/b5c0a68d-8387-4909-beea-f70ab9e6e3d5@kernel.org
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
include/uapi/linux/types.h | 5 +++--
tools/include/linux/types.h | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index c4dc597f3dcf..2415d5dcb5d3 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -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;
diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h
index 051fdeaf2670..5908e58c3598 100644
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -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
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "linux/types.h: remove unnecessary __bitwise__"
2022-05-25 14:46 [PATCH] Revert "linux/types.h: remove unnecessary __bitwise__" Bjorn Helgaas
@ 2022-05-25 16:02 ` Linus Torvalds
2022-05-26 9:00 ` Jiri Slaby
0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2022-05-25 16:02 UTC (permalink / raw)
To: Bjorn Helgaas, Jiri Slaby
Cc: Andrew Morton, Jonathan Corbet, Nathan Chancellor,
Nick Desaulniers, Michael S . Tsirkin, llvm,
open list:DOCUMENTATION, Linux Kernel Mailing List,
Bjorn Helgaas
On Wed, May 25, 2022 at 7:46 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> 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(+)
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index c4dc597f3dcf..308433be33c2 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "linux/types.h: remove unnecessary __bitwise__"
2022-05-25 16:02 ` Linus Torvalds
@ 2022-05-26 9:00 ` Jiri Slaby
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2022-05-26 9:00 UTC (permalink / raw)
To: Linus Torvalds, Bjorn Helgaas
Cc: Andrew Morton, Jonathan Corbet, Nathan Chancellor,
Nick Desaulniers, Michael S . Tsirkin, llvm,
open list:DOCUMENTATION, Linux Kernel Mailing List,
Bjorn Helgaas
On 25. 05. 22, 18:02, Linus Torvalds wrote:
> On Wed, May 25, 2022 at 7:46 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>>
>> 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?
Yes, thanks.
> ---
> include/uapi/linux/types.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
> index c4dc597f3dcf..308433be33c2 100644
> --- a/include/uapi/linux/types.h
> +++ b/include/uapi/linux/types.h
> @@ -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;
--
js
suse labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-26 9:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 14:46 [PATCH] Revert "linux/types.h: remove unnecessary __bitwise__" Bjorn Helgaas
2022-05-25 16:02 ` Linus Torvalds
2022-05-26 9:00 ` Jiri Slaby
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.