mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user