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 <yu-chu.yang@intel.com>
This commit is contained in:
Yang, Yu-chu 2018-06-22 16:58:11 -07:00 committed by Xie, nanlin
parent 5b14df3a35
commit a69a36960a

View File

@ -18,7 +18,7 @@
#define foreach_vcpu(idx, vm, vcpu) \ #define foreach_vcpu(idx, vm, vcpu) \
for (idx = 0, vcpu = vm->hw.vcpu_array[idx]; \ 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]) idx++, vcpu = vm->hw.vcpu_array[idx])