[Intel-gfx] [PATCH 30/37] io-mapping.h: Sparse __iomem annotations

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 10 23:45:17 CET 2010


Propagate __iomem from ioremap() through the inline helpers.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 include/asm-generic/io.h   |    2 +-
 include/linux/io-mapping.h |   30 +++++++++++++++---------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index bcee636..de638a3 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -258,7 +258,7 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
 #define ioremap_wc ioremap_nocache
 #endif
 
-static inline void iounmap(void *addr)
+static inline void iounmap(void __iomem *addr)
 {
 }
 
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 97eb928..08efda1 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -77,7 +77,7 @@ io_mapping_free(struct io_mapping *mapping)
 }
 
 /* Atomic map/unmap */
-static inline void *
+static inline void __iomem *
 io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset)
 {
 	resource_size_t phys_addr;
@@ -90,12 +90,12 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset)
 }
 
 static inline void
-io_mapping_unmap_atomic(void *vaddr)
+io_mapping_unmap_atomic(void __iomem *vaddr)
 {
 	iounmap_atomic(vaddr, KM_USER0);
 }
 
-static inline void *
+static inline void __iomem *
 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
 {
 	resource_size_t phys_addr;
@@ -107,7 +107,7 @@ io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
 }
 
 static inline void
-io_mapping_unmap(void *vaddr)
+io_mapping_unmap(void __iomem *vaddr)
 {
 	iounmap(vaddr);
 }
@@ -118,39 +118,39 @@ io_mapping_unmap(void *vaddr)
 struct io_mapping;
 
 /* Create the io_mapping object*/
-static inline struct io_mapping *
+static inline struct io_mapping __iomem *
 io_mapping_create_wc(resource_size_t base, unsigned long size)
 {
-	return (struct io_mapping *) ioremap_wc(base, size);
+	return (struct io_mapping __iomem *) ioremap_wc(base, size);
 }
 
 static inline void
-io_mapping_free(struct io_mapping *mapping)
+io_mapping_free(struct io_mapping __iomem *mapping)
 {
 	iounmap(mapping);
 }
 
 /* Atomic map/unmap */
-static inline void *
-io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset)
+static inline void __iomem *
+io_mapping_map_atomic_wc(struct io_mapping __iomem *mapping, unsigned long offset)
 {
-	return ((char *) mapping) + offset;
+	return ((u8 __iomem *) mapping) + offset;
 }
 
 static inline void
-io_mapping_unmap_atomic(void *vaddr)
+io_mapping_unmap_atomic(void __iomem *vaddr)
 {
 }
 
 /* Non-atomic map/unmap */
-static inline void *
-io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
+static inline void __iomem *
+io_mapping_map_wc(struct io_mapping __iomem *mapping, unsigned long offset)
 {
-	return ((char *) mapping) + offset;
+	return ((u8 __iomem *) mapping) + offset;
 }
 
 static inline void
-io_mapping_unmap(void *vaddr)
+io_mapping_unmap(void __iomem *vaddr)
 {
 }
 
-- 
1.7.0




More information about the Intel-gfx mailing list