[PATCH RFC 01/15] Update ioremap() prototype to conform to the Linux one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cc: Thomas Huth <thuth@xxxxxxxxxx>
Cc: Andrew Jones <drjones@xxxxxxxxxx>
Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx>
---
 lib/alloc.h          | 7 -------
 lib/asm-generic/io.h | 4 ++--
 lib/libcflat.h       | 7 +++++++
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/alloc.h b/lib/alloc.h
index 7a73c18bef97..81f5369c9283 100644
--- a/lib/alloc.h
+++ b/lib/alloc.h
@@ -58,13 +58,6 @@ static inline void *memalign(size_t alignment, size_t size)
 	return alloc_ops->memalign(alignment, size);
 }
 
-#ifdef PHYS32
-typedef u32 phys_addr_t;
-#else
-typedef u64 phys_addr_t;
-#endif
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
-
 /*
  * phys_alloc is a very simple allocator which allows physical memory
  * to be partitioned into regions until all memory is allocated.
diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h
index 931415a465b7..49283d6eb020 100644
--- a/lib/asm-generic/io.h
+++ b/lib/asm-generic/io.h
@@ -153,10 +153,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 *)phys_addr;
 }
 #endif
 
diff --git a/lib/libcflat.h b/lib/libcflat.h
index b58a8a1954ef..44cc9c868726 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -48,6 +48,13 @@ typedef _Bool		bool;
 #define false 0
 #define true  1
 
+#ifdef PHYS32
+typedef u32 phys_addr_t;
+#else
+typedef u64 phys_addr_t;
+#endif
+#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
+
 #if __SIZEOF_LONG__ == 8
 #  define __PRI64_PREFIX	"l"
 #  define __PRIPTR_PREFIX	"l"
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux