[PATCH 04/41] powerpc: Make PTRRELOC() 32-bit only

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Jul 5 15:03:40 AEST 2016


PTRRELOC is only used by 32-bit code since on 32-bit systems, early_init
can be run with relocation off and running at an offset. Define it to
identity on 64-bit

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 arch/powerpc/include/asm/setup.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index e9d384c..fa0687e 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -19,7 +19,11 @@ extern unsigned long reloc_offset(void);
 extern unsigned long add_reloc_offset(unsigned long);
 extern void reloc_got2(unsigned long);
 
+#ifdef CONFIG_PPC32
 #define PTRRELOC(x)	((typeof(x)) add_reloc_offset((unsigned long)(x)))
+#else
+#define PTRRELOC(x)	(x)
+#endif
 
 void check_for_initrd(void);
 void initmem_init(void);
-- 
2.7.4



More information about the Linuxppc-dev mailing list