[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 51/53] spapr: Add return value to spapr_irq_check()
From: |
David Gibson |
Subject: |
[PULL 51/53] spapr: Add return value to spapr_irq_check() |
Date: |
Fri, 4 Oct 2019 19:37:45 +1000 |
Explicitly return success or failure, rather than just relying on the
Error ** parameter. This makes handling it less verbose in the caller.
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
---
hw/ppc/spapr_irq.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 3ac67ba0c7..0413fbd0a3 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -529,7 +529,7 @@ SpaprIrq spapr_irq_dual = {
};
-static void spapr_irq_check(SpaprMachineState *spapr, Error **errp)
+static int spapr_irq_check(SpaprMachineState *spapr, Error **errp)
{
MachineState *machine = MACHINE(spapr);
@@ -545,7 +545,7 @@ static void spapr_irq_check(SpaprMachineState *spapr, Error
**errp)
*/
if (spapr->irq == &spapr_irq_dual) {
spapr->irq = &spapr_irq_xics;
- return;
+ return 0;
}
/*
@@ -565,7 +565,7 @@ static void spapr_irq_check(SpaprMachineState *spapr, Error
**errp)
*/
if (spapr->irq == &spapr_irq_xive) {
error_setg(errp, "XIVE-only machines require a POWER9 CPU");
- return;
+ return -1;
}
}
@@ -579,8 +579,10 @@ static void spapr_irq_check(SpaprMachineState *spapr,
Error **errp)
machine_kernel_irqchip_required(machine) &&
xics_kvm_has_broken_disconnect(spapr)) {
error_setg(errp, "KVM is too old to support
ic-mode=dual,kernel-irqchip=on");
- return;
+ return -1;
}
+
+ return 0;
}
/*
@@ -589,7 +591,6 @@ static void spapr_irq_check(SpaprMachineState *spapr, Error
**errp)
void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
{
MachineState *machine = MACHINE(spapr);
- Error *local_err = NULL;
if (machine_kernel_irqchip_split(machine)) {
error_setg(errp, "kernel_irqchip split mode not supported on pseries");
@@ -602,9 +603,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
return;
}
- spapr_irq_check(spapr, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
+ if (spapr_irq_check(spapr, errp) < 0) {
return;
}
--
2.21.0
- [PULL 36/53] xics: Eliminate reset hook, (continued)
- [PULL 36/53] xics: Eliminate reset hook, David Gibson, 2019/10/04
- [PULL 34/53] xics: Eliminate 'reject', 'resend' and 'eoi' class hooks, David Gibson, 2019/10/04
- [PULL 42/53] spapr: Eliminate nr_irqs parameter to SpaprIrq::init, David Gibson, 2019/10/04
- [PULL 38/53] xics: Create sPAPR specific ICS subtype, David Gibson, 2019/10/04
- [PULL 40/53] spapr: Replace spapr_vio_qirq() helper with spapr_vio_irq_pulse() helper, David Gibson, 2019/10/04
- [PULL 39/53] spapr: Fold spapr_phb_lsi_qirq() into its single caller, David Gibson, 2019/10/04
- [PULL 43/53] spapr: Fix indexing of XICS irqs, David Gibson, 2019/10/04
- [PULL 46/53] spapr: Remove unhelpful tracepoints from spapr_irq_free_xics(), David Gibson, 2019/10/04
- [PULL 45/53] spapr: Eliminate SpaprIrq:get_nodename method, David Gibson, 2019/10/04
- [PULL 41/53] spapr: Clarify and fix handling of nr_irqs, David Gibson, 2019/10/04
- [PULL 51/53] spapr: Add return value to spapr_irq_check(),
David Gibson <=
- [PULL 44/53] spapr: Simplify spapr_qirq() handling, David Gibson, 2019/10/04
- [PULL 48/53] spapr, xics, xive: Better use of assert()s on irq claim/free paths, David Gibson, 2019/10/04
- [PULL 47/53] spapr: Handle freeing of multiple irqs in frontend only, David Gibson, 2019/10/04
- [PULL 49/53] xive: Improve irq claim/free path, David Gibson, 2019/10/04
- [PULL 50/53] spapr: Use less cryptic representation of which irq backends are supported, David Gibson, 2019/10/04
- [PULL 53/53] ppc/pnv: Remove the XICSFabric Interface from the POWER9 machine, David Gibson, 2019/10/04
- [PULL 52/53] spapr: Eliminate SpaprIrq::init hook, David Gibson, 2019/10/04
- Re: [PULL 00/53] ppc-for-4.2 queue 20191004, Peter Maydell, 2019/10/07