[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/14] spapr/xive: Rework error handling in kvmppc_xive_get_q
From: |
David Gibson |
Subject: |
Re: [PATCH 07/14] spapr/xive: Rework error handling in kvmppc_xive_get_queues() |
Date: |
Thu, 13 Aug 2020 20:24:27 +1000 |
On Mon, Aug 10, 2020 at 06:54:40PM +0200, Greg Kurz wrote:
> Since kvmppc_xive_get_queue_config() has a return value, convert
> kvmppc_xive_get_queues() 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 | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
> index 696623f717b7..4142aaffff47 100644
> --- a/hw/intc/spapr_xive_kvm.c
> +++ b/hw/intc/spapr_xive_kvm.c
> @@ -467,23 +467,24 @@ void kvmppc_xive_reset(SpaprXive *xive, Error **errp)
> NULL, true, errp);
> }
>
> -static void kvmppc_xive_get_queues(SpaprXive *xive, Error **errp)
> +static int kvmppc_xive_get_queues(SpaprXive *xive, Error **errp)
> {
> - Error *local_err = NULL;
> int i;
> + int ret;
>
> for (i = 0; i < xive->nr_ends; i++) {
> if (!xive_end_is_valid(&xive->endt[i])) {
> continue;
> }
>
> - kvmppc_xive_get_queue_config(xive, SPAPR_XIVE_BLOCK_ID, i,
> - &xive->endt[i], &local_err);
> - if (local_err) {
> - error_propagate(errp, local_err);
> - return;
> + ret = kvmppc_xive_get_queue_config(xive, SPAPR_XIVE_BLOCK_ID, i,
> + &xive->endt[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
- Re: [PATCH 02/14] spapr/xive: Rework error handling of kvmppc_xive_cpu_connect(), (continued)
- [PATCH 03/14] spapr/xive: Rework error handling of kvmppc_xive_source_reset(), Greg Kurz, 2020/08/10
- [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
- Re: [PATCH 07/14] spapr/xive: Rework error handling in kvmppc_xive_get_queues(),
David Gibson <=
- [PATCH 08/14] spapr/xive: Rework error handling of kvmppc_xive_set_source_config(), Greg Kurz, 2020/08/10
- [PATCH 09/14] spapr/kvm: Fix error handling in kvmppc_xive_pre_save(), Greg Kurz, 2020/08/10
- [PATCH 10/14] spapr/xive: Fix error handling in kvmppc_xive_post_load(), Greg Kurz, 2020/08/10
- [PATCH 11/14] ppc/xive: Fix error handling in vmstate_xive_tctx_*() callbacks, Greg Kurz, 2020/08/10
- [PATCH 12/14] spapr/xive: Simplify error handling in kvmppc_xive_connect(), Greg Kurz, 2020/08/10