ARM is moving to stricter checks on readl/write functions,
so we need to use the correct types everywhere.
I'm not completely sure about this patch, and it will
probably require some arch/sh changes to go along with it,
but it's clear that something has to be done to avoid
getting hundreds of new warnings on each shmobile build
in v3.7.
Please see this as a prototype.
Cc: Paul Mundt
Cc: Magnus Damm
Cc: Simon Horman
Cc: Kuninori Morimoto
Cc: linux...@vger.kernel.org
Signed-off-by: Arnd Bergmann
---
drivers/sh/intc/access.c| 56 +--
drivers/sh/intc/chip.c |8 +++
drivers/sh/intc/core.c |6 +++--
drivers/sh/intc/handle.c|6 ++---
drivers/sh/intc/internals.h | 18 +++---
drivers/sh/intc/virq.c |3 ++-
include/linux/sh_clk.h |4 ++--
7 files changed, 52 insertions(+), 49 deletions(-)
diff --git a/drivers/sh/intc/access.c b/drivers/sh/intc/access.c
index f892ae1..5bd0a56 100644
--- a/drivers/sh/intc/access.c
+++ b/drivers/sh/intc/access.c
@@ -11,7 +11,7 @@
#include
#include "internals.h"
-unsigned long intc_phys_to_virt(struct intc_desc_int *d, unsigned long address)
+void __iomem *intc_phys_to_virt(struct intc_desc_int *d, unsigned long address)
{
struct intc_window *window;
int k;
@@ -27,23 +27,23 @@ unsigned long intc_phys_to_virt(struct intc_desc_int *d,
unsigned long address)
continue;
address -= window->phys;
- address += (unsigned long)window->virt;
- return address;
+ return window->virt + address;
}
/* no windows defined, register must be 1:1 mapped virt:phys */
- return address;
+ return (void __iomem *)address;
}
unsigned int intc_get_reg(struct intc_desc_int *d, unsigned long address)
{
unsigned int k;
+ void __iomem *virt;
- address = intc_phys_to_virt(d, address);
+ virt = intc_phys_to_virt(d, address);
for (k = 0; k < d->nr_reg; k++) {
- if (d->reg[k] == address)
+ if (d->reg[k] == virt)
return k;
}
@@ -72,25 +72,25 @@ unsigned long intc_get_field_from_handle(unsigned int
value, unsigned int handle
return (value & mask) >> shift;
}
-static unsigned long test_8(unsigned long addr, unsigned long h,
+static unsigned long test_8(void __iomem * addr, unsigned long h,
unsigned long ignore)
{
return intc_get_field_from_handle(__raw_readb(addr), h);
}
-static unsigned long test_16(unsigned long addr, unsigned long h,
+static unsigned long test_16(void __iomem * addr, unsigned long h,
unsigned long ignore)
{
return intc_get_field_from_handle(__raw_readw(addr), h);
}
-static unsigned long test_32(unsigned long addr, unsigned long h,
+static unsigned long test_32(void __iomem * addr, unsigned long h,
unsigned long ignore)
{
return intc_get_field_from_handle(__raw_readl(addr), h);
}
-static unsigned long write_8(unsigned long addr, unsigned long h,
+static unsigned long write_8(void __iomem * addr, unsigned long h,
unsigned long data)
{
__raw_writeb(intc_set_field_from_handle(0, data, h), addr);
@@ -98,7 +98,7 @@ static unsigned long write_8(unsigned long addr, unsigned
long h,
return 0;
}
-static unsigned long write_16(unsigned long addr, unsigned long h,
+static unsigned long write_16(void __iomem * addr, unsigned long h,
unsigned long data)
{
__raw_writew(intc_set_field_from_handle(0, data, h), addr);
@@ -106,7 +106,7 @@ static unsigned long write_16(unsigned long addr, unsigned
long h,
return 0;
}
-static unsigned long write_32(unsigned long addr, unsigned long h,
+static unsigned long write_32(void __iomem * addr, unsigned long h,
unsigned long data)
{
__raw_writel(intc_set_field_from_handle(0, data, h), addr);
@@ -114,7 +114,7 @@ static unsigned long write_32(unsigned long addr, unsigned
long h,
return 0;
}
-static unsigned long modify_8(unsigned long addr, unsigned long h,
+static unsigned long modify_8(void __iomem * addr, unsigned long h,
unsigned long data)
{
unsigned long flags;
@@ -127,7 +127,7 @@ static unsigned long modify_8(unsigned long addr, unsigned
long h,
return 0;
}
-static unsigned long modify_16(unsigned long addr, unsigned long h,
+static unsigned long modify_16(void __iomem * addr, unsigned long h,
unsigned long data)
{
unsigned long flags;
@@ -140,7 +140,7 @@ static unsigned long modify_16(unsigned long addr, unsigned
long h,
return 0;
}
-static unsigned long modify_32(unsigned long addr, unsigned long h,
+static unsigned long modify_32(void __iomem *