From 5a583fb87c856abb42ea640ba54fb1d101b9e36d Mon Sep 17 00:00:00 2001 From: Chaohong guo Date: Fri, 21 Dec 2018 10:45:37 +0800 Subject: [PATCH] HV: move global variable into the scope of calling function The static global variable apicv_apic_access_addr is used only by vlapic_apicv_get_apic_access_addr(), to remove the warning by MISRA, move it into function scope. Tracked-On: #861 Signed-off-by: Chaohong guo Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/vlapic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hypervisor/arch/x86/guest/vlapic.c b/hypervisor/arch/x86/guest/vlapic.c index bbea0485d..8512e62c4 100644 --- a/hypervisor/arch/x86/guest/vlapic.c +++ b/hypervisor/arch/x86/guest/vlapic.c @@ -77,9 +77,6 @@ static inline void vlapic_dump_irr(__unused const struct acrn_vlapic *vlapic, __ static inline void vlapic_dump_isr(__unused const struct acrn_vlapic *vlapic, __unused const char *msg) {} #endif -/*APIC-v APIC-access address */ -static uint8_t apicv_apic_access_addr[PAGE_SIZE] __aligned(PAGE_SIZE); - static int32_t apicv_set_intr_ready(struct acrn_vlapic *vlapic, uint32_t vector); @@ -2345,6 +2342,9 @@ apicv_batch_set_tmr(const struct acrn_vlapic *vlapic) uint64_t vlapic_apicv_get_apic_access_addr(void) { + /*APIC-v APIC-access address */ + static uint8_t apicv_apic_access_addr[PAGE_SIZE] __aligned(PAGE_SIZE); + return hva2hpa(apicv_apic_access_addr); }