hv: vioapic: minor refine about vioapic_init

Most code in the if ... else is duplicated. We could put it out of the
conditional statement.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1
2020-04-23 10:05:01 +08:00
committed by wenlingz
parent 2c9c681e6d
commit 907a0f7c04
3 changed files with 46 additions and 64 deletions

View File

@@ -38,6 +38,7 @@
*/
#include <apicreg.h>
#include <ioapic.h>
#include <util.h>
#define VIOAPIC_BASE 0xFEC00000UL
@@ -55,10 +56,7 @@
struct acrn_single_vioapic {
spinlock_t mtx;
struct acrn_vm *vm;
uint32_t base_addr;
uint32_t nr_pins;
uint32_t gsi_base;
uint32_t id;
struct ioapic_info chipinfo;
bool ready;
uint32_t ioregsel;
union ioapic_rte rtbl[REDIR_ENTRIES_HW];