Commit 782a6de4 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

fix iomem misannotations in nozomi

aka if you see a force-cast, be very suspicious...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Acked-and-tested-by: default avatarFrank Seidel <fseidel@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 683113a3
...@@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start, ...@@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
u32 size_bytes) u32 size_bytes)
{ {
u32 i = 0; u32 i = 0;
const u32 *ptr = (__force u32 *) mem_addr_start; const u32 __iomem *ptr = mem_addr_start;
u16 *buf16; u16 *buf16;
if (unlikely(!ptr || !buf)) if (unlikely(!ptr || !buf))
...@@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start, ...@@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
switch (size_bytes) { switch (size_bytes) {
case 2: /* 2 bytes */ case 2: /* 2 bytes */
buf16 = (u16 *) buf; buf16 = (u16 *) buf;
*buf16 = __le16_to_cpu(readw((void __iomem *)ptr)); *buf16 = __le16_to_cpu(readw(ptr));
goto out; goto out;
break; break;
case 4: /* 4 bytes */ case 4: /* 4 bytes */
*(buf) = __le32_to_cpu(readl((void __iomem *)ptr)); *(buf) = __le32_to_cpu(readl(ptr));
goto out; goto out;
break; break;
} }
...@@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start, ...@@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
if (size_bytes - i == 2) { if (size_bytes - i == 2) {
/* Handle 2 bytes in the end */ /* Handle 2 bytes in the end */
buf16 = (u16 *) buf; buf16 = (u16 *) buf;
*(buf16) = __le16_to_cpu(readw((void __iomem *)ptr)); *(buf16) = __le16_to_cpu(readw(ptr));
i += 2; i += 2;
} else { } else {
/* Read 4 bytes */ /* Read 4 bytes */
*(buf) = __le32_to_cpu(readl((void __iomem *)ptr)); *(buf) = __le32_to_cpu(readl(ptr));
i += 4; i += 4;
} }
buf++; buf++;
...@@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf, ...@@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
u32 size_bytes) u32 size_bytes)
{ {
u32 i = 0; u32 i = 0;
u32 *ptr = (__force u32 *) mem_addr_start; u32 __iomem *ptr = mem_addr_start;
const u16 *buf16; const u16 *buf16;
if (unlikely(!ptr || !buf)) if (unlikely(!ptr || !buf))
...@@ -494,7 +494,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf, ...@@ -494,7 +494,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
switch (size_bytes) { switch (size_bytes) {
case 2: /* 2 bytes */ case 2: /* 2 bytes */
buf16 = (const u16 *)buf; buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); writew(__cpu_to_le16(*buf16), ptr);
return 2; return 2;
break; break;
case 1: /* case 1: /*
...@@ -502,7 +502,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf, ...@@ -502,7 +502,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
* so falling through.. * so falling through..
*/ */
case 4: /* 4 bytes */ case 4: /* 4 bytes */
writel(__cpu_to_le32(*buf), (void __iomem *)ptr); writel(__cpu_to_le32(*buf), ptr);
return 4; return 4;
break; break;
} }
...@@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf, ...@@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
if (size_bytes - i == 2) { if (size_bytes - i == 2) {
/* 2 bytes */ /* 2 bytes */
buf16 = (const u16 *)buf; buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); writew(__cpu_to_le16(*buf16), ptr);
i += 2; i += 2;
} else { } else {
/* 4 bytes */ /* 4 bytes */
writel(__cpu_to_le32(*buf), (void __iomem *)ptr); writel(__cpu_to_le32(*buf), ptr);
i += 4; i += 4;
} }
buf++; buf++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment