aboutsummaryrefslogtreecommitdiff
path: root/hw/xics.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xics.c')
-rw-r--r--hw/xics.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/xics.c b/hw/xics.c
index 7a899dd44f..ff4b5e210f 100644
--- a/hw/xics.c
+++ b/hw/xics.c
@@ -326,8 +326,7 @@ static void ics_eoi(struct ics_state *ics, int nr)
qemu_irq xics_get_qirq(struct icp_state *icp, int irq)
{
- if ((irq < icp->ics->offset)
- || (irq >= (icp->ics->offset + icp->ics->nr_irqs))) {
+ if (!ics_valid_irq(icp->ics, irq)) {
return NULL;
}
@@ -336,8 +335,7 @@ qemu_irq xics_get_qirq(struct icp_state *icp, int irq)
void xics_set_irq_type(struct icp_state *icp, int irq, bool lsi)
{
- assert((irq >= icp->ics->offset)
- && (irq < (icp->ics->offset + icp->ics->nr_irqs)));
+ assert(ics_valid_irq(icp->ics, irq));
icp->ics->irqs[irq - icp->ics->offset].lsi = lsi;
}