Thread (3 messages) 3 messages, 3 authors, 2016-12-08

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

From: Cornelia Huck <hidden>
Date: 2016-12-08 11:26:11
Also in: dri-devel, kvm, linux-crypto, linux-kbuild, linux-s390, linux-scsi, lkml, netdev

On Thu, 8 Dec 2016 04:29:39 +0200
"Michael S. Tsirkin" [off-list ref] wrote:
By now, linux is mostly endian-clean. Enabling endian-ness
checks for everyone produces about 200 new sparse warnings for me -
less than 10% over the 2000 sparse warnings already there.
Out of curiousity: Where do most of those warnings show up?
quoted hunk ↗ jump to hunk
Not a big deal, OTOH enabling this helps people notice
they are introducing new bugs.

So let's just drop __CHECK_ENDIAN__. Follow-up patches
can drop distinction between __bitwise and __bitwise__.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

Linus, could you ack this for upstream? If yes I'll
merge through my tree as a replacement for enabling
this just for virtio.

 include/uapi/linux/types.h | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index acf0979..41e5914 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -23,11 +23,7 @@
 #else
 #define __bitwise__
 #endif
-#ifdef __CHECK_ENDIAN__
 #define __bitwise __bitwise__
-#else
-#define __bitwise
-#endif

 typedef __u16 __bitwise __le16;
 typedef __u16 __bitwise __be16;
FWIW, I like this better than just enabling it for the virtio code.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help