diff mbox series

[PULL,27/29] ppc/xics: allow ICSState to have an offset 0

Message ID 20190108224600.23125-28-david@gibson.dropbear.id.au
State New
Headers show
Series [PULL,01/29] spapr: Add H-Call H_HOME_NODE_ASSOCIATIVITY | expand

Commit Message

David Gibson Jan. 8, 2019, 10:45 p.m. UTC
From: Cédric Le Goater <clg@kaod.org>

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 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 7668c381a8..07508cbd21 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -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 {