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

@@ -184,8 +184,9 @@ static void update_trampoline_code_refs(uint64_t dest_pa)
*(uint64_t *)(ptr) += dest_pa;
ptr = HPA2HVA(dest_pa + trampoline_relo_addr(&trampoline_pdpt_addr));
for (i = 0; i < 4; i++)
for (i = 0; i < 4; i++) {
*(uint64_t *)(ptr + sizeof(uint64_t) * i) += dest_pa;
}
/* update the gdt base pointer with relocated offset */
ptr = HPA2HVA(dest_pa + trampoline_relo_addr(&trampoline_gdt_ptr));