Skip to contentSkip to conversation

arm: it's OK to pass pointer to volatile as iounmap() argument...

PATCH In review Al Viro 2 participants 2 messages Oct 9, 2006 – Oct 11, 2006 Arm (32-bit)

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 arm: it's OK to pass pointer to volatile as iounmap() argument...

---
 arch/arm/mm/ioremap.c |    6 +++---
 include/asm-arm/io.h  |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mm/ioremap.c +3 -3
index 591fc31..4654405 100644
@@ -361,14 +361,14 @@ __ioremap(unsigned long phys_addr, size_
 }
 EXPORT_SYMBOL(__ioremap);
 
-void __iounmap(void __iomem *addr)
+void __iounmap(volatile void __iomem *addr)
 {
 #ifndef CONFIG_SMP
 	struct vm_struct **p, *tmp;
 #endif
 	unsigned int section_mapping = 0;
 
-	addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr);
+	addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long)addr);
 
 #ifndef CONFIG_SMP
 	/*
@@ -395,6 +395,6 @@ #ifndef CONFIG_SMP
 #endif
 
 	if (!section_mapping)
-		vunmap(addr);
+		vunmap((void __force *)addr);
 }
 EXPORT_SYMBOL(__iounmap);
include/asm-arm/io.h +1 -1
index 8076a85..34aaaac 100644
@@ -63,7 +63,7 @@ #define __raw_readl(a)		(__chk_io_ptr(a)
  */
 extern void __iomem * __ioremap_pfn(unsigned long, unsigned long, size_t, unsigned long);
 extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
-extern void __iounmap(void __iomem *addr);
+extern void __iounmap(volatile void __iomem *addr);
 
 /*
  * Bad read/write accesses...
Signature · 1 line
1.4.2.GIT
#1 lore raw

Hi!

arch/arm/mm/ioremap.c __ioremap(unsigned long phys_addr, size_ · line 364

Quoted 8 lines
arch/arm/mm/ioremap.c +1 -1
@@ -361,14 +361,14 @@ __ioremap(unsigned long phys_addr, size_
 }
 EXPORT_SYMBOL(__ioremap);
 
-void __iounmap(void __iomem *addr)
+void __iounmap(volatile void __iomem *addr)

Who is crazy enough to pass volatile pointers here? I guess they should be fixed, instead.

Pavel

Signature · 1 line
Thanks for all the (sleeping) penguins.