All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks
@ 2017-10-06 17:23 Bart Van Assche
  2017-10-06 17:35 ` Christoph Hellwig
  2017-10-09 13:22 ` Michael S. Tsirkin
  0 siblings, 2 replies; 14+ messages in thread
From: Bart Van Assche @ 2017-10-06 17:23 UTC (permalink / raw)
  To: Michael S . Tsirkin
  Cc: linux-kernel, Bart Van Assche, Christoph Hellwig, Linus Torvalds

The purpose of patch "linux/types.h: enable endian checks for all
sparse builds" was to encourage driver authors to annotate
endianness correctly in their drivers. However, since that patch
went upstream no endianness annotations in drivers have been fixed.
I think that this shows that the followed approach does not work,
probably because several driver authors do not use sparse. Restore
the ability to disable sparse endianness checks such that it
becomes again easy to review other sparse diagnostics for people
who want to analyze drivers they are not the author of.

References: commit 05de97003c77 ("linux/types.h: enable endian checks for all sparse builds")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
---
 include/uapi/linux/types.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index 41e5914f0a8e..d3dcb0764c45 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -23,7 +23,11 @@
 #else
 #define __bitwise__
 #endif
+#if !defined(__CHECK_ENDIAN__) || __CHECK_ENDIAN__ != 0
 #define __bitwise __bitwise__
+#else
+#define __bitwise
+#endif
 
 typedef __u16 __bitwise __le16;
 typedef __u16 __bitwise __be16;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-10-16 17:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 17:23 [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks Bart Van Assche
2017-10-06 17:35 ` Christoph Hellwig
2017-10-06 17:43   ` Bart Van Assche
2017-10-16  9:33     ` Javier González
2017-10-09 13:22 ` Michael S. Tsirkin
2017-10-09 15:07   ` Bart Van Assche
2017-10-09 17:42     ` Michael S. Tsirkin
2017-10-10 16:38       ` Bart Van Assche
2017-10-16 13:34         ` Michael S. Tsirkin
2017-10-16 13:57           ` Bart Van Assche
2017-10-16 15:27             ` Michael S. Tsirkin
2017-10-16 15:36               ` Bart Van Assche
2017-10-16 16:50                 ` Michael S. Tsirkin
2017-10-16 17:36                   ` Bart Van Assche

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.