From 960a479f7f94bb615991d41b8c5ff4e3c7d0088d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 4 Jul 2018 14:03:10 +0200 Subject: ioapic: remove useless lower bounds check The vector cannot be negative. Coverity now reports this because it sees an array access before the check, in ioapic_stat_update_irq. Reviewed-by: Peter Xu Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/intc/ioapic.c') diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index b393780..b6896ac 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -152,7 +152,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level) if (vector == 0) { vector = 2; } - if (vector >= 0 && vector < IOAPIC_NUM_PINS) { + if (vector < IOAPIC_NUM_PINS) { uint32_t mask = 1 << vector; uint64_t entry = s->ioredtbl[vector]; -- cgit v1.1