From patchwork Thu Dec 8 02:29:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 9465645 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 27C6A60512 for ; Thu, 8 Dec 2016 02:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BBAC28532 for ; Thu, 8 Dec 2016 02:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 003D22853B; Thu, 8 Dec 2016 02:30:14 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 3BC0F28533 for ; Thu, 8 Dec 2016 02:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934035AbcLHC3r (ORCPT ); Wed, 7 Dec 2016 21:29:47 -0500 Received: from mail.kernel.org ([198.145.29.136]:42746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932759AbcLHC3p (ORCPT ); Wed, 7 Dec 2016 21:29:45 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C47852026F; Thu, 8 Dec 2016 02:29:43 +0000 (UTC) Received: from redhat.com (pool-173-76-100-203.bstnma.fios.verizon.net [173.76.100.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6966920268; Thu, 8 Dec 2016 02:29:40 +0000 (UTC) Date: Thu, 8 Dec 2016 04:29:39 +0200 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org, Linus Torvalds , Christoph Hellwig Cc: linux-kernel@vger.kernel.org, Jason Wang , linux-kbuild@vger.kernel.org, Michal Marek , Arnd Bergmann , Greg Kroah-Hartman , Matt Mackall , Herbert Xu , David Airlie , Gerd Hoffmann , Ohad Ben-Cohen , Christian Borntraeger , Cornelia Huck , "James E.J. Bottomley" , "David S. Miller" , Jens Axboe , Neil Armstrong , Stefan Hajnoczi , Asias He , linux-crypto@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-scsi@vger.kernel.org, v9fs-developer@lists.sourceforge.net Subject: [PATCH] linux/types.h: enable endian checks for all sparse builds Message-ID: <1481164052-28036-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email 2.8.0.287.g0deeb61 X-Mutt-Fcc: =sent X-Virus-Scanned: ClamAV using ClamSMTP Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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 Suggested-by: Christoph Hellwig Signed-off-by: Michael S. Tsirkin --- 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;