Skip to content

Commit 93b6547

Browse files
mstsirkinmatosatti
authored andcommitted
KVM: switch to symbolic name for irq_states size
Use PIC_NUM_PINS instead of hard-coded 16 for pic pins. Signed-off-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
1 parent c7a7062 commit 93b6547

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/x86/kvm/irq.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct kvm_pic {
7070
struct kvm_io_device dev_slave;
7171
struct kvm_io_device dev_eclr;
7272
void (*ack_notifier)(void *opaque, int irq);
73-
unsigned long irq_states[16];
73+
unsigned long irq_states[PIC_NUM_PINS];
7474
};
7575

7676
struct kvm_pic *kvm_create_pic(struct kvm *kvm);

virt/kvm/irq_comm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
343343
switch (ue->u.irqchip.irqchip) {
344344
case KVM_IRQCHIP_PIC_MASTER:
345345
e->set = kvm_set_pic_irq;
346-
max_pin = 16;
346+
max_pin = PIC_NUM_PINS;
347347
break;
348348
case KVM_IRQCHIP_PIC_SLAVE:
349349
e->set = kvm_set_pic_irq;
350-
max_pin = 16;
350+
max_pin = PIC_NUM_PINS;
351351
delta = 8;
352352
break;
353353
case KVM_IRQCHIP_IOAPIC:

0 commit comments

Comments
 (0)