Skip to content

Commit

Permalink
m68k: Prevent some compiler warnings in Coldfire builds
Browse files Browse the repository at this point in the history
Since commit d3b41b6 ("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>
  • Loading branch information
Finn Thain authored and geertu committed Aug 19, 2019
1 parent aee6bff commit 94c0439
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
9 changes: 0 additions & 9 deletions arch/m68k/include/asm/atarihw.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include <linux/types.h>
#include <asm/bootinfo-atari.h>
#include <asm/raw_io.h>
#include <asm/kmap.h>

extern u_long atari_mch_cookie;
Expand Down Expand Up @@ -132,14 +131,6 @@ extern struct atari_hw_present atari_hw_present;
*/


#define atari_readb raw_inb
#define atari_writeb raw_outb

#define atari_inb_p raw_inb
#define atari_outb_p raw_outb



#include <linux/mm.h>
#include <asm/cacheflush.h>

Expand Down
6 changes: 5 additions & 1 deletion arch/m68k/include/asm/io_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
#include <asm-generic/iomap.h>

#ifdef CONFIG_ATARI
#include <asm/atarihw.h>
#define atari_readb raw_inb
#define atari_writeb raw_outb

#define atari_inb_p raw_inb
#define atari_outb_p raw_outb
#endif


Expand Down
1 change: 1 addition & 0 deletions arch/m68k/include/asm/macintosh.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/irq.h>

#include <asm/bootinfo-mac.h>

Expand Down

0 comments on commit 94c0439

Please sign in to comment.