Skip to content

Commit 2fefff3

Browse files
KaigeFuwenlingz
authored andcommitted
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 <kaige.fu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent eff9459 commit 2fefff3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hypervisor/arch/x86/ioapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static uint64_t legacy_irq_trigger_mode[NR_LEGACY_IRQ] = {
5757
IOAPIC_RTE_TRGREDG, /* IRQ15*/
5858
};
5959

60-
uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN] = {
60+
const uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN] = {
6161
2U, /* pin0*/
6262
1U, /* pin1*/
6363
0U, /* pin2*/

hypervisor/include/arch/x86/ioapic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ struct gsi_table {
6868

6969
extern struct gsi_table gsi_table[NR_MAX_GSI];
7070
extern uint32_t nr_gsi;
71-
extern uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN];
71+
extern const uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN];
7272

7373
#endif /* IOAPIC_H */

0 commit comments

Comments
 (0)