From: Greg Ungerer <gerg@xxxxxxxxxxxxxx> Commit d3b41b6bb49e ("m68k: Dispatch nvram_ops calls to Atari or Mac functions") causes a number of compile time warnings to be generated if compiling for a ColdFire MMU enabled target: In file included from ./arch/m68k/include/asm/atarihw.h:25:0, from arch/m68k/kernel/setup_mm.c:41, from arch/m68k/kernel/setup.c:3: ./arch/m68k/include/asm/raw_io.h:39:0: warning: "__raw_readb" redefined #define __raw_readb in_8 ^ In file included from ./arch/m68k/include/asm/io.h:6:0, from arch/m68k/kernel/setup_mm.c:36, from arch/m68k/kernel/setup.c:3: ./arch/m68k/include/asm/io_no.h:16:0: note: this is the location of the previous definition #define __raw_readb(addr) \ ^ ... The most strait forward fix is to conditionaly include only those headers actually required, and to only check for machine types that are configured/enabled into this build. Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx> --- arch/m68k/kernel/setup_mm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index 528484feff80..04853f68f7a8 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -38,14 +38,16 @@ #ifdef CONFIG_AMIGA #include <asm/amigahw.h> #endif -#include <asm/atarihw.h> #ifdef CONFIG_ATARI +#include <asm/atarihw.h> #include <asm/atari_stram.h> #endif #ifdef CONFIG_SUN3X #include <asm/dvma.h> #endif +#ifdef CONFIG_MAC #include <asm/macintosh.h> +#endif #include <asm/natfeat.h> #if !FPSTATESIZE || !NR_IRQS @@ -602,10 +604,14 @@ static long m68k_nvram_initialize(void) static ssize_t m68k_nvram_get_size(void) { +#ifdef CONFIG_ATARI if (MACH_IS_ATARI) return atari_nvram_get_size(); - else if (MACH_IS_MAC) +#endif +#ifdef CONFIG_MAC + if (MACH_IS_MAC) return mac_pram_get_size(); +#endif return -ENODEV; } -- 2.17.1