ppc/xics: allow ICSState to have an offset 0
authorCédric Le Goater <clg@kaod.org>
Wed, 2 Jan 2019 05:57:41 +0000 (06:57 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 8 Jan 2019 22:28:14 +0000 (09:28 +1100)
commit 15ed653fa49a ("ppc/xics: An ICS with offset 0 is assumed to be
uninitialized") introduced an extra check on the ICS offset which is
not strictly necessary.

Revert the change to be able to map the XICS IRQ number space on the
XIVE IRQ number space.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
include/hw/ppc/xics.h

index 7668c381a887a1c8a01d89e9041eecbe36100eec..07508cbd217e9a71e23f9e5e9a80e7a31748ca1f 100644 (file)
@@ -139,8 +139,7 @@ struct ICSState {
 
 static inline bool ics_valid_irq(ICSState *ics, uint32_t nr)
 {
-    return (ics->offset != 0) && (nr >= ics->offset)
-        && (nr < (ics->offset + ics->nr_irqs));
+    return (nr >= ics->offset) && (nr < (ics->offset + ics->nr_irqs));
 }
 
 struct ICSIRQState {