aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2020-08-10 18:54:12 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2020-08-13 21:00:52 +1000
commit46407a2531da4ff206c1aefe8c3f6d8ad53f2de4 (patch)
tree21cad31da6b38922e49df416fa75cfd1e4afdd64 /hw/intc
parent3885ca66881f1d2568e169dcbf793fd493146d14 (diff)
downloadqemu-46407a2531da4ff206c1aefe8c3f6d8ad53f2de4.zip
qemu-46407a2531da4ff206c1aefe8c3f6d8ad53f2de4.tar.gz
qemu-46407a2531da4ff206c1aefe8c3f6d8ad53f2de4.tar.bz2
spapr/xive: Rework error handling of kvmppc_xive_source_reset()
Since kvmppc_xive_source_reset_one() has a return value, convert kvmppc_xive_source_reset() to use it for error checking. This allows to get rid of the local_err boiler plate. Propagate the return value so that callers may use it as well to check failures. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <159707845245.1489912.9151822670764690034.stgit@bahia.lan> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/spapr_xive_kvm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index aa1a2f9..d801bf5 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -248,24 +248,25 @@ int kvmppc_xive_source_reset_one(XiveSource *xsrc, int srcno, Error **errp)
true, errp);
}
-static void kvmppc_xive_source_reset(XiveSource *xsrc, Error **errp)
+static int kvmppc_xive_source_reset(XiveSource *xsrc, Error **errp)
{
SpaprXive *xive = SPAPR_XIVE(xsrc->xive);
int i;
for (i = 0; i < xsrc->nr_irqs; i++) {
- Error *local_err = NULL;
+ int ret;
if (!xive_eas_is_valid(&xive->eat[i])) {
continue;
}
- kvmppc_xive_source_reset_one(xsrc, i, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
+ ret = kvmppc_xive_source_reset_one(xsrc, i, errp);
+ if (ret < 0) {
+ return ret;
}
}
+
+ return 0;
}
/*