hv: fix MISRA-C issues related to for loop

This patch fixes the following issues:
- Assignment operation in expression.
- For loop incrementation is not simple.
- No brackets to loop body.
- Use of comma operator.

v1 -> v2:
 * Replace &x->y with &(x->y) based on our new coding rule

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Shiqing Gao
2018-08-24 11:21:20 +08:00
committed by wenlingz
parent 852f613fe3
commit 10c64a5fca
6 changed files with 23 additions and 14 deletions

View File

@@ -96,8 +96,9 @@ int load_guest(struct vm *vm, struct vcpu *vcpu)
lowmem_gpa_top = *(uint64_t *)hva;
/* hardcode vcpu entry addr(kernel entry) & rsi (zeropage)*/
for (i = 0; i < NUM_GPRS; i++)
for (i = 0; i < NUM_GPRS; i++) {
vcpu_set_gpreg(vcpu, i, 0UL);
}
hva = GPA2HVA(vm, lowmem_gpa_top -
MEM_4K - MEM_2K);
@@ -169,8 +170,9 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
/* Documentation states: ebx=0, edi=0, ebp=0, esi=ptr to
* zeropage
*/
for (i = 0; i < NUM_GPRS; i++)
for (i = 0; i < NUM_GPRS; i++) {
vcpu_set_gpreg(vcpu, i, 0UL);
}
/* Get host-physical address for guest bootargs */
hva = GPA2HVA(vm,