From 2fefff34a7fa37505f46bac61f4ef6d50ab0274b Mon Sep 17 00:00:00 2001 From: Kaige Fu Date: Tue, 18 Dec 2018 13:14:58 +0000 Subject: [PATCH] HV: x86: fix "Global variable should be declared const" Gloabal variable should be declared constant wherever possible to avoid unintentional modification. Tracked-On: #861 Signed-off-by: Kaige Fu Acked-by: Eddie Dong --- hypervisor/arch/x86/ioapic.c | 2 +- hypervisor/include/arch/x86/ioapic.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/ioapic.c b/hypervisor/arch/x86/ioapic.c index d6b21211e..c99fe76d7 100644 --- a/hypervisor/arch/x86/ioapic.c +++ b/hypervisor/arch/x86/ioapic.c @@ -57,7 +57,7 @@ static uint64_t legacy_irq_trigger_mode[NR_LEGACY_IRQ] = { IOAPIC_RTE_TRGREDG, /* IRQ15*/ }; -uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN] = { +const uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN] = { 2U, /* pin0*/ 1U, /* pin1*/ 0U, /* pin2*/ diff --git a/hypervisor/include/arch/x86/ioapic.h b/hypervisor/include/arch/x86/ioapic.h index cadb5c0eb..630f5dcda 100644 --- a/hypervisor/include/arch/x86/ioapic.h +++ b/hypervisor/include/arch/x86/ioapic.h @@ -68,6 +68,6 @@ struct gsi_table { extern struct gsi_table gsi_table[NR_MAX_GSI]; extern uint32_t nr_gsi; -extern uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN]; +extern const uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN]; #endif /* IOAPIC_H */