[PATCH 5/9] KVM: selftests: Prevent PAGE_SIZE redefinition on x86

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

 



Prevent PAGE_SIZE redefinition warnings that can occur due to namespace
pollution from included headers.

Add an #ifndef directive before defining PAGE_SIZE to avoid redefinition
conflicts.

Signed-off-by: Aqib Faruqui <aqibaf@xxxxxxxxxx>
---
 tools/testing/selftests/kvm/include/x86/processor.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h
index 2efb05c2f..3f93d1b4f 100644
--- a/tools/testing/selftests/kvm/include/x86/processor.h
+++ b/tools/testing/selftests/kvm/include/x86/processor.h
@@ -368,7 +368,9 @@ static inline unsigned int x86_model(unsigned int eax)
 #define PHYSICAL_PAGE_MASK      GENMASK_ULL(51, 12)
 
 #define PAGE_SHIFT		12
+#ifndef PAGE_SIZE
 #define PAGE_SIZE		(1ULL << PAGE_SHIFT)
+#endif
 #define PAGE_MASK		(~(PAGE_SIZE-1) & PHYSICAL_PAGE_MASK)
 
 #define HUGEPAGE_SHIFT(x)	(PAGE_SHIFT + (((x) - 1) * 9))
-- 
2.47.3





[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