diff mbox

[kvm-unit-tests,v7,10/11] io: Make ioremap() prototype conform to Linux one

Message ID ecf3e4326729ab7b74d0ba0505930a244d5dfcc5.1462457467.git.agordeev@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexander Gordeev May 5, 2016, 2:26 p.m. UTC
This update also adds missing __iomem specificator which
has been used by existing IO accessors.

Cc: Andrew Jones <drjones@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Radim Kr?má? <rkrcmar@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 lib/asm-generic/io.h | 4 ++--
 lib/ppc64/asm/io.h   | 2 ++
 lib/x86/asm/io.h     | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h
index 1834720..41756db 100644
--- a/lib/asm-generic/io.h
+++ b/lib/asm-generic/io.h
@@ -156,10 +156,10 @@  static inline u64 __bswap64(u64 x)
 	({ wmb(); __raw_writeq(cpu_to_le64(b), addr); })
 
 #ifndef ioremap
-static inline void *ioremap(u64 phys_addr, size_t size __unused)
+static inline void __iomem *ioremap(phys_addr_t phys_addr, size_t size __unused)
 {
 	assert(sizeof(long) == 8 || !(phys_addr >> 32));
-	return (void *)(unsigned long)phys_addr;
+	return (void __iomem *)(unsigned long)phys_addr;
 }
 #endif
 
diff --git a/lib/ppc64/asm/io.h b/lib/ppc64/asm/io.h
index 4f2c31b..2b4dd2b 100644
--- a/lib/ppc64/asm/io.h
+++ b/lib/ppc64/asm/io.h
@@ -9,5 +9,7 @@ 
 #error Undefined byte order
 #endif
 
+#define __iomem
+
 #include <asm-generic/io.h>
 #endif
diff --git a/lib/x86/asm/io.h b/lib/x86/asm/io.h
index c944df4..83387b5 100644
--- a/lib/x86/asm/io.h
+++ b/lib/x86/asm/io.h
@@ -1,6 +1,8 @@ 
 #ifndef _ASM_X86_IO_H_
 #define _ASM_X86_IO_H_
 
+#define __iomem
+
 static inline unsigned char inb(unsigned short port)
 {
     unsigned char value;