From patchwork Tue Oct 31 17:21:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 10034979 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 13B2D60327 for ; Tue, 31 Oct 2017 17:22:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC98428BD4 for ; Tue, 31 Oct 2017 17:22:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E151728BC0; Tue, 31 Oct 2017 17:22:32 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87DB628BC5 for ; Tue, 31 Oct 2017 17:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=o1xf4m7o+YMb7+4aNLiqgfeEzYCsMnRGXKC91pT4Kto=; b=khF O6SKjtPgR8roxYqS3dRV5qCc1IVHX4Syspvnwgq9eQRwJc92vyEv6c3ukIRHCKcrBf+znnVpvfT/x +hicE4olVGgfS6+ROWFU/8KbjXVrXww3cFY8g759lmfmBqlve5H9eyhqseIIG03uptzZ4ddOp7UtT jIh/UaXDcERvhu48+LufXEeHOLekBYi9upcNHlj21DbbwfVUivaU+lqOioXigf5hFxjff1fReg0ks F4T4aU6TiVJGQIdwl60a5JEgl/4fLAa9UtHOxWTCuiFt9EaJq6iG/ee2Ples5lMum5aXYr01sHvoU uex9rRvYX+WmDJ9UURFcS6G95+os97w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9aF7-0003Sp-Ct; Tue, 31 Oct 2017 17:22:25 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9aF3-0003Op-Ni for linux-arm-kernel@lists.infradead.org; Tue, 31 Oct 2017 17:22:23 +0000 Received: by mail-wm0-x241.google.com with SMTP id b9so325986wmh.0 for ; Tue, 31 Oct 2017 10:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0mfwN92flxhSMM9awf+iLa2NTdAdnXag4L0m3tfDS5I=; b=t2lkZ0h/20A4nDfZB2o58Gcs58t2chzNT+M1ahUSnKAGIs/4UyPh9XGRNATBtKy3VZ Os3/dEh3ePvXw6zG+yTfUuGW/x1/942d4vlSiH8C62yzp8VZfnq812fAXbwZQLu2RI6Q 9VgOoqvkTegQkAp7FX6YcCgaHHAsX1WnxfMMJPoVVXRANnyjYKXzZBY5Xiwg6keEBCRT 7dFhjifC2ODKHR6LwCgz5J7H9TdG/M+87o+6f1lKtTXpPPh7+qzWBM1QOZvyyVa/fayQ zg37wUm7nxhf7i6dF9CM0v7HZwQp4ea68ZZTS/OzhAnOUazRQ7B4+iuR7nicozgjpGkQ MkrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0mfwN92flxhSMM9awf+iLa2NTdAdnXag4L0m3tfDS5I=; b=kJOgW2LzudmWGousHSrkY0j/TprkZIcb7CYlBc2+7U2eFyTsAeD4UGyW4Hi0aJUZIs nyD0ubvuKLKFN7UHT5ZiOKIvFBqjx5+gWrrvvjm7fjg/2G75s1XvKS5V1Ji7ro+w14Ef k5kJAz+LXX6orhgSFOgsSBb5rj5Wa7rj6bGVea6j6QIAzYGUlxYXioja0LKblqygTlPb IW3UsepRaLo6KwPSg5mLfiTTH4vLB4YQBWmFOXQc83KrZ0/VRjQTxBPnFfKBZh93Cwie 7+6STSfze0TIM+kAezaNIiPCh5+0N1lTD5b0iLGIwpgo6Q5ZAS+4oz8jL8jMJIEyRCLE J6MA== X-Gm-Message-State: AMCzsaVSkRuj07y+sJ3NPEpKaWl3xxJmxUGK4e2XR5tmgYkclkQ28tau q5TbK0Jcl7i/6WzSQm+WY64= X-Google-Smtp-Source: ABhQp+TGxDkpCdNvTy1Zw47m2oz/9kVINAUZkSEwXgLYNBaqM96T4QYd48+cg3L/r0+HJBZ3yWr0pA== X-Received: by 10.80.154.35 with SMTP id o32mr3788460edb.125.1509470519542; Tue, 31 Oct 2017 10:21:59 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:40c4:1100:bd6e:5921:70f7:5f9c]) by smtp.gmail.com with ESMTPSA id 88sm1472517edq.49.2017.10.31.10.21.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 10:21:58 -0700 (PDT) From: Luc Van Oostenryck To: Russell King Subject: [PATCH] arm: pass endianness info to sparse Date: Tue, 31 Oct 2017 18:21:57 +0100 Message-Id: <20171031172157.9744-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171031_102222_025229_E91E19EE X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Luc Van Oostenryck MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ARM depends on the macros '__ARMEL__' & '__ARMEB__' being defined or not to correctly select or define endian-specific macros, structures or pieces of code. These macros are predefined by the compiler but sparse knows nothing about them and thus may pre-process files differently from what gcc would. Fix this by passing '-D__ARMEL__' or '-D__ARMEB__' to sparse, depending on the endianness of the kernel, like defined by GCC. Note: In most case it won't change anything since most ARMs use little-endian (but an allyesconfig would use big-endian!). To: Russell King CC: linux-arm-kernel@lists.infradead.org Signed-off-by: Luc Van Oostenryck --- arch/arm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 817e5cfef..36ae44545 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -44,10 +44,12 @@ endif ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) KBUILD_CPPFLAGS += -mbig-endian +CHECKFLAGS += -D__ARMEB__ AS += -EB LD += -EB else KBUILD_CPPFLAGS += -mlittle-endian +CHECKFLAGS += -D__ARMEL__ AS += -EL LD += -EL endif