diff mbox

[kvm-unit-tests,v7,06/11] io: Separate overrides of virt_to_phys() and phys_to_virt()

Message ID 7a7af5609f97d67eca003ba36dd26884593af7e9.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
Generic implementations of virt_to_phys() and phys_to_virt()
are currently covered by a single "virt_to_phys" macro.
Introduce additional macro "phys_to_virt" to allow separate
overrides.

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 | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h
index 931415a..3585ac0 100644
--- a/lib/asm-generic/io.h
+++ b/lib/asm-generic/io.h
@@ -165,7 +165,9 @@  static inline unsigned long virt_to_phys(volatile void *address)
 {
 	return __pa((unsigned long)address);
 }
+#endif
 
+#ifndef phys_to_virt
 static inline void *phys_to_virt(unsigned long address)
 {
 	return __va(address);