From 55691aed466124c5e7b5c58e51aea907e6ab3875 Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Wed, 26 Dec 2018 17:49:53 +0800 Subject: [PATCH] hv: fix coding style violations in mmu.c Fix violations that attempt to change parameter passed by value. Tracked-On: #2056 Signed-off-by: Yonghua Huang Acked-by: Eddie Dong --- hypervisor/arch/x86/mmu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hypervisor/arch/x86/mmu.c b/hypervisor/arch/x86/mmu.c index 25f9c4889..b71350abd 100644 --- a/hypervisor/arch/x86/mmu.c +++ b/hypervisor/arch/x86/mmu.c @@ -222,14 +222,16 @@ void enable_smap(void) */ void hv_access_memory_region_update(uint64_t base, uint64_t size) { + uint64_t base_aligned; + uint64_t size_aligned; uint64_t region_end = base + size; /*rounddown base to 2MBytes aligned.*/ - base = round_pde_down(base); - size = region_end - base; + base_aligned = round_pde_down(base); + size_aligned = region_end - base_aligned; - mmu_modify_or_del((uint64_t *)ppt_mmu_pml4_addr, base, round_pde_up(size), - 0UL, PAGE_USER, &ppt_mem_ops, MR_MODIFY); + mmu_modify_or_del((uint64_t *)ppt_mmu_pml4_addr, base_aligned, + round_pde_up(size_aligned), 0UL, PAGE_USER, &ppt_mem_ops, MR_MODIFY); } void init_paging(void)