From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751038AbdAQP01 (ORCPT ); Tue, 17 Jan 2017 10:26:27 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:54871 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbdAQP00 (ORCPT ); Tue, 17 Jan 2017 10:26:26 -0500 From: Arnd Bergmann To: Ralf Baechle Cc: linux-mips@linux-mips.org, Arnd Bergmann , Paul Burton , linux-kernel@vger.kernel.org Subject: [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Date: Tue, 17 Jan 2017 16:18:36 +0100 Message-Id: <20170117151911.4109452-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170117151911.4109452-1-arnd@arndb.de> References: <20170117151911.4109452-1-arnd@arndb.de> X-Provags-ID: V03:K0:VX1v0OsZWCt148dFLOvpKocBdKHM73qSWnPzksuf19eZLzgtQ6Z XjCzqh6tajZ39nW9mp5mNZfI5OtCBtA6HzeUiYWWw/bk5Kvu+0wK2mvdpHFmHCFfyLnls3j cTQOUdilQN5c+UliRla07rmFbf8BhBXabk5YeVjWiLwileJrQSj5R/RRs2JHqcGo95AjN+Q LOz20mSbiB6+9CFSNN3IQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:fjH1iahTZZ0=:f3HAhkgXp2DhsYlkwVeHGz k0RMYjUuulArVFgbzKOO9SH0cE5lgTMIUnHwqeX+wwhcQnqZdCX3RLlMOSF9x0OSIWVIqpG8E O+qCyemS3TJxwEAUZutQcCHbUeNZXM11RqeJgPBU7VkvWyWzCkTXeVFaM/rS9TszsIPyxHAfy TNR7KqUAUipu/AcZIwACBG8hlBOh2xWtPTIYGmpNgoUKdcEUf3xKgfDasHDidTA+cp9JyE8tu LTwYOAzCqpH3ceermpyET9VpsHBgFlrLaaGCTxOoTW3then9+jFl2CC3E/1AQ00kIsUxy62XK 7wqevCSIk8/ncXFhKWIpsMW0WZ8Ag23SK0Ue3DG6pY4ggniGz7hcUwNx/bn+LhUxcm0dGBjOX j6mMijWgSrlAE5FFV4eRmurKdO5UxuawKThBXsLU1kEATjKd7Ow5AKZyQhq2Jgym+2K3+zJMt vnf5zJJ/IPWfcObeF0+qNlze8T1BZN+l+P7afUGGrXO8+4X26WA+7hKnJ0S28AwnsxjhfCgN0 VLQcHKv0j5QgqKBjMuIXbQZX+4Ai6HQDa6Wjto1y07dE8/QfH3K+OcAHZTtkVdXqRZNwbs3M3 QQHdIUV4YvRqh7HvKinjZhZhh5gl5ZZggt54uVtkviCAFZBsvbRl61mkqk98LNFepA6F0XB4w VNwmi9gM1tUVoM+gD9yaYG27niUIR80Kqzy8x02FGBGxzbPmIXcDiFDMTHm09Zd7jOe4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vdso.h includes implicitly after defining CONFIG_32BITS. This defeats the override in mach-ip27/spaces.h, leading to a build error that shows up in kernelci.org: In file included from arch/mips/include/asm/mach-ip27/spaces.h:29:0, from arch/mips/include/asm/page.h:12, from arch/mips/vdso/vdso.h:26, from arch/mips/vdso/gettimeofday.c:11: arch/mips/include/asm/mach-generic/spaces.h:28:0: error: "CAC_BASE" redefined [-Werror] #define CAC_BASE _AC(0x80000000, UL) An earlier patch tried to make the second definition conditional, but that patch had the #ifdef in the wrong place, and would lead to another warning: arch/mips/include/asm/io.h: In function 'phys_to_virt': arch/mips/include/asm/io.h:138:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] For all I can tell, there is no other reason than vdso32 to ever include this file with CONFIG_32BITS set, and the vdso itself should never refer to the base addresses as it is running in user space, so adding an #ifdef here is safe. Link: https://patchwork.kernel.org/patch/9418187/ Fixes: 3ffc17d8768b ("MIPS: Adjust MIPS64 CAC_BASE to reflect Config.K0") Signed-off-by: Arnd Bergmann --- arch/mips/include/asm/mach-ip27/spaces.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/mach-ip27/spaces.h b/arch/mips/include/asm/mach-ip27/spaces.h index 4775a1136a5b..24d5e31bcfa6 100644 --- a/arch/mips/include/asm/mach-ip27/spaces.h +++ b/arch/mips/include/asm/mach-ip27/spaces.h @@ -12,14 +12,16 @@ /* * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects - * uncached memory addressing. + * uncached memory addressing. Hide the definitions on 32-bit compilation + * of the compat-vdso code. */ - +#ifdef CONFIG_64BIT #define HSPEC_BASE 0x9000000000000000 #define IO_BASE 0x9200000000000000 #define MSPEC_BASE 0x9400000000000000 #define UNCAC_BASE 0x9600000000000000 #define CAC_BASE 0xa800000000000000 +#endif #define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) #define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK)) -- 2.9.0