From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752425AbdJFRX5 (ORCPT ); Fri, 6 Oct 2017 13:23:57 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:49198 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751491AbdJFRX4 (ORCPT ); Fri, 6 Oct 2017 13:23:56 -0400 X-IronPort-AV: E=Sophos;i="5.42,484,1500912000"; d="scan'208";a="56644896" From: Bart Van Assche To: "Michael S . Tsirkin" Cc: linux-kernel@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Linus Torvalds Subject: [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks Date: Fri, 6 Oct 2017 10:23:53 -0700 Message-Id: <20171006172353.16758-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Christoph Hellwig Cc: Linus Torvalds --- 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