[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/14] spapr/xive: Rework error handling of kvmppc_xive_sourc
From: |
David Gibson |
Subject: |
Re: [PATCH 03/14] spapr/xive: Rework error handling of kvmppc_xive_source_reset() |
Date: |
Thu, 13 Aug 2020 20:15:15 +1000 |
On Mon, Aug 10, 2020 at 06:54:12PM +0200, Greg Kurz wrote:
> 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>
Applied to ppc-for-5.2.
> ---
> hw/intc/spapr_xive_kvm.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
> index aa1a2f915363..d801bf5cd11c 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;
> }
>
> /*
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [PATCH 00/14] ppc/spapr: Error handling fixes and cleanups, Greg Kurz, 2020/08/10
- [PATCH 02/14] spapr/xive: Rework error handling of kvmppc_xive_cpu_connect(), Greg Kurz, 2020/08/10
- [PATCH 03/14] spapr/xive: Rework error handling of kvmppc_xive_source_reset(), Greg Kurz, 2020/08/10
- Re: [PATCH 03/14] spapr/xive: Rework error handling of kvmppc_xive_source_reset(),
David Gibson <=
- [PATCH 04/14] spapr/xive: Rework error handling of kvmppc_xive_mmap(), Greg Kurz, 2020/08/10
- [PATCH 05/14] spapr/xive: Rework error handling of kvmppc_xive_cpu_[gs]et_state(), Greg Kurz, 2020/08/10
- [PATCH 06/14] spapr/xive: Rework error handling of kvmppc_xive_[gs]et_queue_config(), Greg Kurz, 2020/08/10
- [PATCH 07/14] spapr/xive: Rework error handling in kvmppc_xive_get_queues(), Greg Kurz, 2020/08/10
- [PATCH 08/14] spapr/xive: Rework error handling of kvmppc_xive_set_source_config(), Greg Kurz, 2020/08/10