Skip to content

Commit e7619f2

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: vgic: Kill VGIC_MAX_PRIVATE definition
VGIC_MAX_PRIVATE is a pretty useless definition, and is better replaced with VGIC_NR_PRIVATE_IRQS. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20241117165757.247686-4-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent add570b commit e7619f2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

arch/arm64/kvm/vgic/vgic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ struct vgic_irq *vgic_get_vcpu_irq(struct kvm_vcpu *vcpu, u32 intid)
106106
return NULL;
107107

108108
/* SGIs and PPIs */
109-
if (intid <= VGIC_MAX_PRIVATE) {
110-
intid = array_index_nospec(intid, VGIC_MAX_PRIVATE + 1);
109+
if (intid < VGIC_NR_PRIVATE_IRQS) {
110+
intid = array_index_nospec(intid, VGIC_NR_PRIVATE_IRQS);
111111
return &vcpu->arch.vgic_cpu.private_irqs[intid];
112112
}
113113

include/kvm/arm_vgic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#define VGIC_NR_SGIS 16
2727
#define VGIC_NR_PPIS 16
2828
#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS)
29-
#define VGIC_MAX_PRIVATE (VGIC_NR_PRIVATE_IRQS - 1)
3029
#define VGIC_MAX_SPI 1019
3130
#define VGIC_MAX_RESERVED 1023
3231
#define VGIC_MIN_LPI 8192

0 commit comments

Comments
 (0)