From patchwork Mon Oct 16 17:26:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10009401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 294D8601D5 for ; Mon, 16 Oct 2017 17:31:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 168F42869C for ; Mon, 16 Oct 2017 17:31:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81E2A286AE; Mon, 16 Oct 2017 17:31:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53884286C6 for ; Mon, 16 Oct 2017 17:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753428AbdJPRaw (ORCPT ); Mon, 16 Oct 2017 13:30:52 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:22288 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbdJPRav (ORCPT ); Mon, 16 Oct 2017 13:30:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1508175052; x=1539711052; h=from:to:cc:subject:date:message-id; bh=5rLTbY0kBu6HRWDGHzlO+vjQLShRO6XTe2LqliZls4Y=; b=fNjz2xq1Tgkc6Ms3C0/0IJmkEVhJyCJb+NJk0J6QweZ0Sq3AN8XOk1bA /ho9EN+TxvICOrX1/5TJnBEy5dVPtdKTzID+UwDwJwqEvB5NBfAIK0yZE 15+0Akt5HoNpqcxe3deLk4LE9aZB5Q9kUptlsSUY5HICyw6fWSguYfg2h Fh7WUrdKuAYy9jTXIi7KajTbbuUxvstjWvC3XuTXm3al8qVcDl8CbBF8D tmqevtzDoyiex0KICSIW+TrIu32qDQolOQlS2Uh8TBQTjWwKLeIq2jUuy Td0uMJ2gujyXM/+EeONnwyYg8rpErBDbE4SdAzAApDJxVtXRrkCs/wan3 Q==; X-IronPort-AV: E=Sophos;i="5.43,387,1503331200"; d="scan'208";a="58441553" Received: from sjappemgw11.hgst.com (HELO sjappemgw12.hgst.com) ([199.255.44.62]) by ob1.hgst.iphmx.com with ESMTP; 17 Oct 2017 01:30:51 +0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.172.152]) by sjappemgw12.hgst.com with ESMTP; 16 Oct 2017 10:26:34 -0700 From: Bart Van Assche To: Linus Torvalds Cc: Bart Van Assche , linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, "Michael S . Tsirkin" , Christoph Hellwig , Leon Romanovsky , Andrew Morton Subject: [PATCH v2] linux/types.h: Restore the ability to disable sparse endianness checks Date: Mon, 16 Oct 2017 10:26:33 -0700 Message-Id: <20171016172633.29290-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. For developers who are not the authors of these drivers it would take a very significant effort to make these drivers endianness clean. Examples are drivers/scsi/qla2xxx and drivers/infiniband/hw/nes. Hence 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: linux-scsi@vger.kernel.org Cc: linux-rdma@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Michael S. Tsirkin Cc: Christoph Hellwig Cc: Leon Romanovsky Cc: Andrew Morton --- [v2]: Elaborated patch description 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;