From patchwork Sat Jun 24 15:38:42 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: 9807801 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 DE4D160382 for ; Sat, 24 Jun 2017 15:41:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD3F028437 for ; Sat, 24 Jun 2017 15:41:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1E5D2877D; Sat, 24 Jun 2017 15:41:40 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM 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 2182728437 for ; Sat, 24 Jun 2017 15:41:39 +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=OJoR+Fc1ne9VVkMfdV/j4qtmwcrJnJK5zLVWwZ9GY0o=; b=tTv 7ncAVcmScN+DC6kvzHB5DLIZI3LyLiHLUgzIePiJrbh7fjITXpSQa7VA4D80EfP3ehKnWR4xMrxem 2zLAofMxALDcRVUuAv+rziaMmCqQmyTwt/RGpou+30KuPdJwoTaYl5wQOdwejJ6ddU8ulwrn37B5j HS/h1A7tcj3IgFfzyw7etDW1fdc7JEDWCWWrw8EWyzgWTpp8ZALAELehDb7tR8FoTxNaZUP+qhI5v 8zbK4ANGsRgqGwcUGQaSsl3N/68x5Cmzyc5Zfg5v6OtYnk8wOlBf4ZqrVYZXvpP85aE0ZEamIzxhg 947KZat4ig2da4Yg5FftM7uNHAnwS4Q==; 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 1dOnBp-0002Fd-K2; Sat, 24 Jun 2017 15:41:37 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOnBP-0002FJ-51 for linux-arm-kernel@lists.infradead.org; Sat, 24 Jun 2017 15:41:13 +0000 Received: by mail-wr0-x244.google.com with SMTP id 77so19866312wrb.3 for ; Sat, 24 Jun 2017 08:40:50 -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=2A/ALeTxejpkc/jYrD3X5tN6ASefSPxAamRsGzcyXKc=; b=K04ZLeyzTDWmZfW4Vbw3D22MM4n7X5cgSqwYPPeqUimpEwA49aESCICVgWdDfz1NLB a0gW8LSIqhZncAq9E78u+AyLRpd9AExgSJlDJHevDuCcAbbbB/Wqn/RfnHSrUB5u9OY+ yEIJp79USLf65AtL6E09O5vmqnoEUQB16HHrPM2xj0E/OvVmiEQE5lhIDtNs/YVLWJtv ru0at/09TathZldCXMbL65Ckj4BMfT7SGxYZZqZQlinSG3NTVqlP5Ri6KaI/zh9r6BLy RjfjhKlz1Yj9Et+2Pg7WQY6QHGm72/5zhBtpL2utA/INgGa2YfkuMemXQXQ2KqCoEarr TlXw== 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=2A/ALeTxejpkc/jYrD3X5tN6ASefSPxAamRsGzcyXKc=; b=cEuHEnCMPCK/eUiVCoaqYjMAj5sIToe0PGwfyMv3LMVZT7pXY5/EJByjj5X41qGmv/ kDtEbkZQv4Y4bZjC6K0ahLhTSN1ZDKQ3JUVUSMH2kEHqHb1lO8EhfFTcmXWMoaFjcv79 RvgPeViTLA8L1PSZkLZFtKBCB4g1D/nomxJOwM79C9VtI5t80ICFhx+TTJeDieJAxcjD Y5S2uzSij3qo3aZJAzhmbOz8N+9iifOqoGgogiiafAMr4Okej4Xw/5D3bTt0B49M3ZfK KZMqQKGUMUF0ej4SUkhpJ5ooFBXwxP8WkM2AAyX/69W+ee3vKBwd70U6dw4MpdIBrwt4 sQiw== X-Gm-Message-State: AKS2vOzE8F+n07BZLiSWe+JBQBu5jE//Xr3Y2lkzesTTY1ftkPlLBx2P wGCSTFg73A86AA== X-Received: by 10.80.146.113 with SMTP id j46mr1714012eda.17.1498318848745; Sat, 24 Jun 2017 08:40:48 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:837:f300:454:6c65:6717:c40e]) by smtp.gmail.com with ESMTPSA id x13sm5317435edb.12.2017.06.24.08.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jun 2017 08:40:47 -0700 (PDT) From: Luc Van Oostenryck To: Subject: [PATCH] arm: pass endianness info to sparse Date: Sat, 24 Jun 2017 17:38:42 +0200 Message-Id: <20170624153842.61064-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170624_084111_402437_741D78BC X-CRM114-Status: UNSURE ( 8.45 ) 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, Russell King , 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 of 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!). CC: 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 65f4e2a4e..0fca46d7f 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