Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87929
b: refs/heads/master
c: 782a6de
h: refs/heads/master
i:
  87927: 6089303
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Mar 30, 2008
1 parent 043fff7 commit 7cbbf25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 683113a33d5b9262bdf3e5cf9c60d9a2ad02cae3
refs/heads/master: 782a6de47b97d5c5f16c84f7868606fa25781fec
20 changes: 10 additions & 10 deletions trunk/drivers/char/nozomi.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
u32 size_bytes)
{
u32 i = 0;
const u32 *ptr = (__force u32 *) mem_addr_start;
const u32 __iomem *ptr = mem_addr_start;
u16 *buf16;

if (unlikely(!ptr || !buf))
Expand All @@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
switch (size_bytes) {
case 2: /* 2 bytes */
buf16 = (u16 *) buf;
*buf16 = __le16_to_cpu(readw((void __iomem *)ptr));
*buf16 = __le16_to_cpu(readw(ptr));
goto out;
break;
case 4: /* 4 bytes */
*(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
*(buf) = __le32_to_cpu(readl(ptr));
goto out;
break;
}
Expand All @@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
if (size_bytes - i == 2) {
/* Handle 2 bytes in the end */
buf16 = (u16 *) buf;
*(buf16) = __le16_to_cpu(readw((void __iomem *)ptr));
*(buf16) = __le16_to_cpu(readw(ptr));
i += 2;
} else {
/* Read 4 bytes */
*(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
*(buf) = __le32_to_cpu(readl(ptr));
i += 4;
}
buf++;
Expand All @@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
u32 size_bytes)
{
u32 i = 0;
u32 *ptr = (__force u32 *) mem_addr_start;
u32 __iomem *ptr = mem_addr_start;
const u16 *buf16;

if (unlikely(!ptr || !buf))
Expand All @@ -494,15 +494,15 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
switch (size_bytes) {
case 2: /* 2 bytes */
buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
writew(__cpu_to_le16(*buf16), ptr);
return 2;
break;
case 1: /*
* also needs to write 4 bytes in this case
* so falling through..
*/
case 4: /* 4 bytes */
writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
writel(__cpu_to_le32(*buf), ptr);
return 4;
break;
}
Expand All @@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
if (size_bytes - i == 2) {
/* 2 bytes */
buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
writew(__cpu_to_le16(*buf16), ptr);
i += 2;
} else {
/* 4 bytes */
writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
writel(__cpu_to_le32(*buf), ptr);
i += 4;
}
buf++;
Expand Down

0 comments on commit 7cbbf25

Please sign in to comment.