diff options
author | Greg Ungerer <gerg@linux-m68k.org> | 2018-04-08 09:12:55 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@linux-m68k.org> | 2018-05-27 19:45:27 -0400 |
commit | 48074d2615add385e6357fc1333959fc778557f9 (patch) | |
tree | e7bd3898d13a2ed5494c32fedfee146c8be9b93c | |
parent | 4a2e130cce1f6ad1b70f0fa8ca1852377fc285ae (diff) |
m68k: introduce iomem() macro for __iomem conversions
A lot of the ColdFire internal peripherals (clocks, timers, interrupt
controllers, etc) are addressed using constants. The only problem with
that is they are not type clean when used with __raw_read/__raw_write
and read/write - they should be of type "void __iomem". This isn't
a problem currently because the IO access functions are local macros.
To switch to using the asm-generic implementations of these we need to
clean up the types. Otherwise you get warnings like this:
In file included from ./arch/m68k/include/asm/mcfsim.h:24:0,
from arch/m68k/coldfire/intc-simr.c:20:
arch/m68k/coldfire/intc-simr.c: In function ‘init_IRQ’:
./arch/m68k/include/asm/m520xsim.h:40:29: warning: passing argument 2 of ‘__raw_writeb’ makes pointer from integer without a cast [-Wint-conversion]
#define MCFINTC0_SIMR (MCFICM_INTC0 + MCFINTC_SIMR)
^
arch/m68k/coldfire/intc-simr.c:182:21: note: in expansion of macro ‘MCFINTC0_SIMR’
__raw_writeb(0xff, MCFINTC0_SIMR);
^
In file included from ./arch/m68k/include/asm/io_no.h:120:0,
from ./arch/m68k/include/asm/io.h:3,
from ./include/linux/io.h:25,
from ./include/linux/irq.h:25,
from ./include/asm-generic/hardirq.h:13,
from ./arch/m68k/include/asm/hardirq.h:25,
from ./include/linux/hardirq.h:9,
from ./include/linux/interrupt.h:13,
from arch/m68k/coldfire/intc-simr.c:16:
./include/asm-generic/io.h:71:22: note: expected ‘volatile void *’ but argument is of type ‘unsigned int’
#define __raw_writeb __raw_writeb
^
./include/asm-generic/io.h:72:20: note: in expansion of macro ‘__raw_writeb’
static inline void __raw_writeb(u8 value, volatile void __iomem *addr)
^
To start this clean up process introduce a macro, iomem(), that converts
a constant address to the correct "void __iomem *" type.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Angelo Dureghello <angelo@sysam.it>
-rw-r--r-- | arch/m68k/include/asm/io_no.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h index ccb8c31faf49..83a0a6d449f4 100644 --- a/arch/m68k/include/asm/io_no.h +++ b/arch/m68k/include/asm/io_no.h | |||
@@ -3,6 +3,12 @@ | |||
3 | #define _M68KNOMMU_IO_H | 3 | #define _M68KNOMMU_IO_H |
4 | 4 | ||
5 | /* | 5 | /* |
6 | * Convert a physical memory address into a IO memory address. | ||
7 | * For us this is trivially a type cast. | ||
8 | */ | ||
9 | #define iomem(a) ((void __iomem *) (a)) | ||
10 | |||
11 | /* | ||
6 | * The non-MMU m68k and ColdFire IO and memory mapped hardware access | 12 | * The non-MMU m68k and ColdFire IO and memory mapped hardware access |
7 | * functions have always worked in CPU native endian. We need to define | 13 | * functions have always worked in CPU native endian. We need to define |
8 | * that behavior here first before we include asm-generic/io.h. | 14 | * that behavior here first before we include asm-generic/io.h. |