From patchwork Sat Jun 24 15:42:11 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: 9807803 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 F3C4F60382 for ; Sat, 24 Jun 2017 15:45:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD17028437 for ; Sat, 24 Jun 2017 15:45:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB6A0285B1; Sat, 24 Jun 2017 15:45:04 +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 53C7D28437 for ; Sat, 24 Jun 2017 15:45:03 +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=UtBfwk+oD62dZv2vDl2gM1+A7K0bT03ImhWPrG3CclE=; b=W5S wYeDk9DYpvO9V/0rdJB/cbWqDEFeUDlyWN+AZL90fbpdGqtJi4oLbqqhM5f0wEv2e1QImsdjWhoBY 9yvm1XfzPg5Z6DdJbUJQLx7D0Ci/bZWh3StqHk0L+tfFMt4HyerfhGY/cGBwJW29XJ+OxSOLl2fsH a308yJsjSHaQj3x9ZTVVJ3c+jd6YEoW8Si6upO0CwzoFjkQ9SwN0EeI74lqx18mHS7i7GLan9YTMe sxJqPz5nccKtN4eX8ktCsXcr7Fp6CJtuUlOC/W1bh3Q1YAWmGmSeEomMky+PXGaBcK/4VavLtIFaL NGXNxBuNJRDH6fz1YyAP0Wkb+ArPD0g==; 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 1dOnF8-0002mm-CX; Sat, 24 Jun 2017 15:45:02 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOnEk-0002lv-34 for linux-arm-kernel@lists.infradead.org; Sat, 24 Jun 2017 15:44:40 +0000 Received: by mail-wr0-x242.google.com with SMTP id 77so19882728wrb.3 for ; Sat, 24 Jun 2017 08:44:17 -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=S09hJ760CESFCv82R2Juo8uuXX2AMNmo2PHkNb6esNs=; b=joewqIKowNnqJAMQ7+4w3f7431O9P+pWcut7XxblvIRiYBTQp2wg3ngMmQYLcD8fek gnp6/49pNDIWzKDJoRY+mo3oQ4sl59ue5tTAS7N76eCBwcMKQMashvOaIJLFdbyhMaln GupfLP5rwqWLwE3phZS/LjnIY21+y2teTngyQUUJ5sNRLhI1EsCHk/TBpgKL8VKfZxeb nFQm3rJe+OsiKtUx6R7+vqvKjSi/6OIhdODCNGtBM0HePMnNqHXSKkwxDJwMNAKKI7DU ID5FF9h6ecz7rGUPlMx2mSBdzj4sXVDwqqxXKam/+wuTs5XWwT6R8bpXynHhwKk1m0Yx 7BhQ== 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=S09hJ760CESFCv82R2Juo8uuXX2AMNmo2PHkNb6esNs=; b=c7zdg9lc6WmIld1gRZBDpao34skAzKYz0m/WEZn9uSI1jaH844qcXLrflE9uXN9yDE qYN/RC7nhRGnc7tkF2BRJOuMJ8ExUDEI1nbF0UKxN/JGbeP0chdgU8r8I24MVfiJ2ZEb zLO5Dt1/wIhtCeOyC51JrG3a4MqHWl5+b5hnbCisn4IXHK+6+hUQO0Ntp99ii1/o1bHN D0dMksvE1onbM5ii+b9pJ8JTy6rHdcEsqYZICPhIgHbJWwqZByXuwlXADsT8ZBuh+all 2LZ3MUg9IF59rK3+ySkXkBN3veV6lFMzu9T6S5VWQxoxTaj3ld+aqjnOe5IcQtTd8KcJ eSGw== X-Gm-Message-State: AKS2vOz8+6JVmIGiYNsa+su7Yggfl3bruIf2s9SEPSAkCc3K/Hp5RQix i0/B2e1bsBia/gn3kac= X-Received: by 10.80.146.47 with SMTP id i44mr10020799eda.48.1498319056364; Sat, 24 Jun 2017 08:44:16 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:837:f300:454:6c65:6717:c40e]) by smtp.gmail.com with ESMTPSA id t50sm4031708edb.41.2017.06.24.08.44.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jun 2017 08:44:15 -0700 (PDT) From: Luc Van Oostenryck To: Subject: [PATCH] arm64: pass endianness info to sparse Date: Sat, 24 Jun 2017 17:42:11 +0200 Message-Id: <20170624154211.61472-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_084438_353176_C748D38E X-CRM114-Status: UNSURE ( 8.67 ) 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: Catalin Marinas , Will Deacon , 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 ARM64 depends on the macro __AARCH64EB__ being defined or not to correctly select or define endian-specific macros, structures or pieces of code. This macro is predefined by the compiler but sparse knows nothing about it and thus may pre-process files differently from what gcc would. Fix this by passing '-D__AARCH64EL__' or '-D__AARCH64EB__' to sparse depending of the endianness of the kernel, like defined by GCC. Note: In most case it won't change anything since most arm64 use little-endian (but an allyesconfig would use big-endian!). CC: Catalin Marinas CC: Will Deacon CC: linux-arm-kernel@lists.infradead.org Signed-off-by: Luc Van Oostenryck --- arch/arm64/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 15d6c1476..8ed11b94a 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -52,11 +52,13 @@ KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) KBUILD_CPPFLAGS += -mbig-endian +CHECKFLAGS += -D__AARCH64EB__ AS += -EB LD += -EB UTS_MACHINE := aarch64_be else KBUILD_CPPFLAGS += -mlittle-endian +CHECKFLAGS += -D__AARCH64EL__ AS += -EL LD += -EL UTS_MACHINE := aarch64