* add __iomem to ioremap
@ 2005-09-25 15:17 Atsushi Nemoto
2005-09-29 23:58 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2005-09-25 15:17 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Some function like iounmap, read[bwlq], etc. have been using __iomem
attribute, but ioremap does not use it. Here is a patch to add
__iomem to ioremap family. This would kill some sparse warnings.
diff -ur /home/cvs/linux-mips/include/asm-mips/io.h linux/include/asm-mips/io.h
--- linux-mips/include/asm-mips/io.h 2005-09-25 00:12:39.000000000 +0900
+++ linux/include/asm-mips/io.h 2005-09-25 23:08:18.930898136 +0900
@@ -203,10 +203,10 @@
*/
#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
-extern void * __ioremap(phys_t offset, phys_t size, unsigned long flags);
+extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
extern void __iounmap(volatile void __iomem *addr);
-static inline void * __ioremap_mode(phys_t offset, unsigned long size,
+static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
unsigned long flags)
{
#define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL))
@@ -220,7 +220,7 @@
*/
if (flags == _CACHE_UNCACHED)
base = (u64) IO_BASE;
- return (void *) (unsigned long) (base + offset);
+ return (void __iomem *) (unsigned long) (base + offset);
} else if (__builtin_constant_p(offset) &&
__builtin_constant_p(size) && __builtin_constant_p(flags)) {
phys_t phys_addr, last_addr;
@@ -238,7 +238,7 @@
*/
if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) &&
flags == _CACHE_UNCACHED)
- return (void *)CKSEG1ADDR(phys_addr);
+ return (void __iomem *)CKSEG1ADDR(phys_addr);
}
diff -ur linux-mips/arch/mips/mm/ioremap.c linux/arch/mips/mm/ioremap.c
--- linux-mips/arch/mips/mm/ioremap.c 2005-07-03 01:09:48.000000000 +0900
+++ linux/arch/mips/mm/ioremap.c 2005-09-25 23:09:24.944862488 +0900
@@ -117,7 +117,7 @@
#define IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL))
-void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
+void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags)
{
struct vm_struct * area;
unsigned long offset;
@@ -137,7 +137,7 @@
*/
if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) &&
flags == _CACHE_UNCACHED)
- return (void *) CKSEG1ADDR(phys_addr);
+ return (void __iomem *) CKSEG1ADDR(phys_addr);
/*
* Don't allow anybody to remap normal RAM that we're using..
@@ -173,7 +173,7 @@
return NULL;
}
- return (void *) (offset + (char *)addr);
+ return (void __iomem *) (offset + (char *)addr);
}
#define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: add __iomem to ioremap
2005-09-25 15:17 add __iomem to ioremap Atsushi Nemoto
@ 2005-09-29 23:58 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2005-09-29 23:58 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
On Mon, Sep 26, 2005 at 12:17:53AM +0900, Atsushi Nemoto wrote:
> Some function like iounmap, read[bwlq], etc. have been using __iomem
> attribute, but ioremap does not use it. Here is a patch to add
> __iomem to ioremap family. This would kill some sparse warnings.
Thanks, applied.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-30 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-25 15:17 add __iomem to ioremap Atsushi Nemoto
2005-09-29 23:58 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox