From a69a36960ad63a279a36b72e38ce0147b1631e2f Mon Sep 17 00:00:00 2001 From: "Yang, Yu-chu" Date: Fri, 22 Jun 2018 16:58:11 -0700 Subject: [PATCH] guest.h: Condition operator fix of foreach_vcpu loop The for loop statement should work in both & and &&, but it seems make more sense to have && when executing a condtion. Signed-off-by: Yang, Yu-chu --- hypervisor/include/arch/x86/guest/guest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypervisor/include/arch/x86/guest/guest.h b/hypervisor/include/arch/x86/guest/guest.h index c77aa1858..f288e7372 100644 --- a/hypervisor/include/arch/x86/guest/guest.h +++ b/hypervisor/include/arch/x86/guest/guest.h @@ -18,7 +18,7 @@ #define foreach_vcpu(idx, vm, vcpu) \ for (idx = 0, vcpu = vm->hw.vcpu_array[idx]; \ - (idx < vm->hw.num_vcpus) & (vcpu != NULL); \ + (idx < vm->hw.num_vcpus) && (vcpu != NULL); \ idx++, vcpu = vm->hw.vcpu_array[idx])