aboutsummaryrefslogtreecommitdiff
path: root/hw/xics.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2012-10-29 17:25:02 +0000
committerAlexander Graf <agraf@suse.de>2012-11-01 13:02:22 +0100
commit1ecbbab46925d4810fc35aba45cf93cb80ff0734 (patch)
tree13c1dd2b271ab51d69b23f07b7ba831150cf2f99 /hw/xics.c
parentbf0175de6c76779d4c8b0606de7bd2a5a0b87c7a (diff)
downloadqemu-1ecbbab46925d4810fc35aba45cf93cb80ff0734.zip
qemu-1ecbbab46925d4810fc35aba45cf93cb80ff0734.tar.gz
qemu-1ecbbab46925d4810fc35aba45cf93cb80ff0734.tar.bz2
pseries: Cleanup duplications of ics_valid_irq() code
A couple of places in xics.c open-coded the same logic as is already implemented in ics_valid_irq(). This patch fixes the code duplication. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
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 7a899dd..ff4b5e2 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;
}