[kvm-unit-tests][PATCH] x86: hypercall: a better fix for the compiler error

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

 



The last patch moves the ifdef in a way that causes a compiler warning.
Here fix the ifdefs to isloate x86_64 functions and variables for the test.

Signed-off-by: Chris J Arges <chris.j.arges@xxxxxxxxxxxxx>
---
 x86/hypercall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/hypercall.c b/x86/hypercall.c
index 3ac5ff9..d134146 100644
--- a/x86/hypercall.c
+++ b/x86/hypercall.c
@@ -24,8 +24,8 @@ static inline long kvm_hypercall0_amd(unsigned int nr)
 }
 
 
-volatile unsigned long test_rip;
 #ifdef __x86_64__
+volatile unsigned long test_rip;
 extern void gp_tss(void);
 asm ("gp_tss: \n\t"
 	"add $8, %rsp\n\t"            // discard error code
@@ -34,7 +34,6 @@ asm ("gp_tss: \n\t"
 	"iretq\n\t"
 	"jmp gp_tss\n\t"
     );
-#endif
 
 static inline int
 test_edge(void)
@@ -47,6 +46,7 @@ test_edge(void)
 	printf("Return from int 13, test_rip = %lx\n", test_rip);
 	return test_rip == (1ul << 47);
 }
+#endif
 
 int main(int ac, char **av)
 {
-- 
1.9.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