From: kfraser@localhost.localdomain Date: Fri, 10 Nov 2006 10:31:29 +0000 (+0000) Subject: [HVM] Remove a duplicated range checking in vioapic_set_irq. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15567^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b6ed0a603f5a91fb61fe37ef52d178cdc607eb19;p=xen.git [HVM] Remove a duplicated range checking in vioapic_set_irq. Since irq range checking has already been done at the beginning of this function. Signed-off-by: Xin Li --- diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 9eae82f40a..dc7f29d820 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -504,6 +504,7 @@ void vioapic_set_xen_irq(struct domain *d, int irq, int level) void vioapic_set_irq(struct domain *d, int irq, int level) { struct vioapic *vioapic = domain_vioapic(d); + uint32_t bit; HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic_set_irq " "irq %x level %x\n", irq, level); @@ -528,22 +529,19 @@ void vioapic_set_irq(struct domain *d, int irq, int level) vioapic->redirtbl[irq].fields.mask, vioapic->redirtbl[irq].fields.dest_id); - if ( (irq >= 0) && (irq < VIOAPIC_NUM_PINS) ) + bit = 1 << irq; + if ( vioapic->redirtbl[irq].fields.trig_mode == VIOAPIC_LEVEL_TRIG ) { - uint32_t bit = 1 << irq; - if ( vioapic->redirtbl[irq].fields.trig_mode == VIOAPIC_LEVEL_TRIG ) - { - if ( level ) - vioapic->irr |= bit; - else - vioapic->irr &= ~bit; - } + if ( level ) + vioapic->irr |= bit; else - { - if ( level ) - /* XXX No irr clear for edge interrupt */ - vioapic->irr |= bit; - } + vioapic->irr &= ~bit; + } + else + { + if ( level ) + /* XXX No irr clear for edge interrupt */ + vioapic->irr |= bit; } service_ioapic(vioapic);