diff options
author | James Hogan <james.hogan@imgtec.com> | 2015-01-05 10:45:30 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-01-13 09:53:09 -0500 |
commit | 50083928bcb38bc847cb885fd70f79a63cabd9b5 (patch) | |
tree | 16d88418d40c1f2860d4d9bbbd308fa8eec1f0e7 /arch | |
parent | c22eacfe82f9c98408f6e7336a2b500a45c9f732 (diff) |
MIPS: mips-cm: Fix sparse warnings
Sparse emits a bunch of warnings in mips-cm.h due to casting away of
__iomem by the addr_gcr_*() functions:
arch/mips/include/asm/mips-cm.h:134:1: warning: cast removes address space of expression
And subsequent passing of the return values to __raw_readl() and
__raw_writel() in the read_gcr_*() and write_gcr_*() functions:
arch/mips/include/asm/mips-cm.h:134:1: warning: incorrect type in argument 2 (different address spaces)
arch/mips/include/asm/mips-cm.h:134:1: expected void volatile [noderef] <asn:2>*mem
arch/mips/include/asm/mips-cm.h:134:1: got unsigned int [usertype] *
arch/mips/include/asm/mips-cm.h:134:1: warning: incorrect type in argument 1 (different address spaces)
arch/mips/include/asm/mips-cm.h:134:1: expected void const volatile [noderef] <asn:2>*mem
arch/mips/include/asm/mips-cm.h:134:1: got unsigned int [usertype] *
Fix by adding __iomem to the addr_gcr_*() return type and cast.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8874/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/include/asm/mips-cm.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index b95a827d763e..59c0901bdd84 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h | |||
@@ -89,9 +89,9 @@ static inline bool mips_cm_has_l2sync(void) | |||
89 | 89 | ||
90 | /* Macros to ease the creation of register access functions */ | 90 | /* Macros to ease the creation of register access functions */ |
91 | #define BUILD_CM_R_(name, off) \ | 91 | #define BUILD_CM_R_(name, off) \ |
92 | static inline u32 *addr_gcr_##name(void) \ | 92 | static inline u32 __iomem *addr_gcr_##name(void) \ |
93 | { \ | 93 | { \ |
94 | return (u32 *)(mips_cm_base + (off)); \ | 94 | return (u32 __iomem *)(mips_cm_base + (off)); \ |
95 | } \ | 95 | } \ |
96 | \ | 96 | \ |
97 | static inline u32 read_gcr_##name(void) \ | 97 | static inline u32 read_gcr_##name(void) \ |