Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: Prevent some compiler warnings in Coldfire builds

Since commit d3b41b6bb49e ("m68k: Dispatch nvram_ops calls to Atari or
Mac functions"), Coldfire builds generate compiler warnings due to the
unconditional inclusion of asm/atarihw.h and asm/macintosh.h.

The inclusion of asm/atarihw.h causes warnings like this:

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) \
...

This issue is resolved by dropping the asm/raw_io.h include. It turns out
that asm/io_mm.h already includes that header file.

Moving the relevant macro definitions helps to clarify this dependency
and make it safe to include asm/atarihw.h.

The other warnings look like this:

In file included from arch/m68k/kernel/setup_mm.c:48:0,
from arch/m68k/kernel/setup.c:3:
./arch/m68k/include/asm/macintosh.h:19:35: warning: 'struct irq_data' declared inside parameter list will not be visible outside of this definition or declaration
extern void mac_irq_enable(struct irq_data *data);
^~~~~~~~
...

This issue is resolved by adding the missing linux/irq.h include.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Finn Thain and committed by
Geert Uytterhoeven
94c04390 aee6bff1

+6 -10
-9
arch/m68k/include/asm/atarihw.h
··· 22 22 23 23 #include <linux/types.h> 24 24 #include <asm/bootinfo-atari.h> 25 - #include <asm/raw_io.h> 26 25 #include <asm/kmap.h> 27 26 28 27 extern u_long atari_mch_cookie; ··· 129 130 * reads from memory). Both '040 and '060 invalidate cache entries on snooped 130 131 * DMA reads (i.e., writes to memory). 131 132 */ 132 - 133 - 134 - #define atari_readb raw_inb 135 - #define atari_writeb raw_outb 136 - 137 - #define atari_inb_p raw_inb 138 - #define atari_outb_p raw_outb 139 - 140 133 141 134 142 135 #include <linux/mm.h>
+5 -1
arch/m68k/include/asm/io_mm.h
··· 29 29 #include <asm-generic/iomap.h> 30 30 31 31 #ifdef CONFIG_ATARI 32 - #include <asm/atarihw.h> 32 + #define atari_readb raw_inb 33 + #define atari_writeb raw_outb 34 + 35 + #define atari_inb_p raw_inb 36 + #define atari_outb_p raw_outb 33 37 #endif 34 38 35 39
+1
arch/m68k/include/asm/macintosh.h
··· 4 4 5 5 #include <linux/seq_file.h> 6 6 #include <linux/interrupt.h> 7 + #include <linux/irq.h> 7 8 8 9 #include <asm/bootinfo-mac.h> 9 10