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

@@ -435,6 +435,9 @@ union ioapic_rte {
#define IOAPIC_REDTBL22 (IOAPIC_REDTBL+0x2cU)
#define IOAPIC_REDTBL23 (IOAPIC_REDTBL+0x2eU)
#define IOAPIC_ID_MASK 0x0f000000U
#define IOAPIC_ID_SHIFT 24U
/* fields in VER, for redirection entry */
#define IOAPIC_MAX_RTE_MASK 0x00ff0000U
#define MAX_RTE_SHIFT 16U