hv: fix "Array has no bounds specified" in vmsr.c

MISRAC requires that the array size should be declared explicitly.

Tracked-On: #861
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Zide Chen 2018-12-05 09:50:22 -08:00 committed by wenlingz
parent 01cb6ba847
commit c3c932027d
1 changed files with 3 additions and 2 deletions

View File

@ -145,7 +145,8 @@ static const uint32_t emulated_msrs[NUM_EMULATED_MSR] = {
/* MSR 0xC90 ... 0xD8F, not in this array */
};
static const uint32_t x2apic_msrs[] = {
#define NUM_X2APIC_MSR 44U
static const uint32_t x2apic_msrs[NUM_X2APIC_MSR] = {
MSR_IA32_EXT_XAPICID,
MSR_IA32_EXT_APIC_VERSION,
MSR_IA32_EXT_APIC_TPR,
@ -240,7 +241,7 @@ static void intercept_x2apic_msrs(uint8_t *msr_bitmap_arg, enum rw_mode mode)
uint8_t *msr_bitmap = msr_bitmap_arg;
uint32_t i;
for (i = 0U; i < ARRAY_SIZE(x2apic_msrs); i++) {
for (i = 0U; i < NUM_X2APIC_MSR; i++) {
enable_msr_interception(msr_bitmap, x2apic_msrs[i], mode);
}
}