Skip to content

Commit a69a369

Browse files
yuchuyangNanlinXie
authored andcommitted
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>
1 parent 5b14df3 commit a69a369

File tree

1 file changed

+1
-1
lines changed
  • hypervisor/include/arch/x86/guest

1 file changed

+1
-1
lines changed

hypervisor/include/arch/x86/guest/guest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#define foreach_vcpu(idx, vm, vcpu) \
2020
for (idx = 0, vcpu = vm->hw.vcpu_array[idx]; \
21-
(idx < vm->hw.num_vcpus) & (vcpu != NULL); \
21+
(idx < vm->hw.num_vcpus) && (vcpu != NULL); \
2222
idx++, vcpu = vm->hw.vcpu_array[idx])
2323

2424

0 commit comments

Comments
 (0)