qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Sagar Karandikar" <sagark@eecs.berkeley.edu>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"Alistair Francis" <Alistair.Francis@wdc.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Max Reitz" <mreitz@redhat.com>,
	Qemu-block <qemu-block@nongnu.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"open list:New World" <qemu-ppc@nongnu.org>,
	"Aleksandar Rikalo" <aleksandar.rikalo@rt-rk.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	qemu-arm <qemu-arm@nongnu.org>, "Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
	"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
	"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
	"Michael Walle" <michael@walle.cc>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [PATCH-for-5.1 v3 07/23] hw/riscv/sifive: Add missing error-propagation code
Date: Mon, 13 Apr 2020 15:12:24 -0700	[thread overview]
Message-ID: <CAKmqyKNKw9hye2AaGocrKozyTA0xb-qDFB=yJ06iV+4xGT8-OA@mail.gmail.com> (raw)
In-Reply-To: <20200412224144.12205-8-f4bug@amsat.org>

On Sun, Apr 12, 2020 at 4:00 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Patch created mechanically by running:
>
>   $ spatch \
>     --macro-file scripts/cocci-macro-file.h --include-headers \
>     --sp-file scripts/coccinelle/use-error_propagate-in-realize.cocci \
>     --keep-comments --smpl-spacing --in-place --dir hw
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/riscv/sifive_e.c |  6 +++++-
>  hw/riscv/sifive_u.c | 24 ++++++++++++++++++++----
>  2 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
> index 0be8b52147..6d4e141ff7 100644
> --- a/hw/riscv/sifive_e.c
> +++ b/hw/riscv/sifive_e.c
> @@ -156,7 +156,11 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev, Error **errp)
>      MemoryRegion *sys_mem = get_system_memory();
>
>      object_property_set_bool(OBJECT(&s->cpus), true, "realized",
> -                            &error_abort);
> +                            &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
>
>      /* MMIO */
>      s->plic = sifive_plic_create(memmap[SIFIVE_E_PLIC].base,
> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> index e13ab34de4..b07526aba1 100644
> --- a/hw/riscv/sifive_u.c
> +++ b/hw/riscv/sifive_u.c
> @@ -508,9 +508,17 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
>      NICInfo *nd = &nd_table[0];
>
>      object_property_set_bool(OBJECT(&s->e_cpus), true, "realized",
> -                             &error_abort);
> +                             &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
>      object_property_set_bool(OBJECT(&s->u_cpus), true, "realized",
> -                             &error_abort);
> +                             &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
>      /*
>       * The cluster must be realized after the RISC-V hart array container,
>       * as the container's CPU object is only created on realize, and the
> @@ -518,9 +526,17 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
>       * cluster is realized.
>       */
>      object_property_set_bool(OBJECT(&s->e_cluster), true, "realized",
> -                             &error_abort);
> +                             &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
>      object_property_set_bool(OBJECT(&s->u_cluster), true, "realized",
> -                             &error_abort);
> +                             &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
>
>      /* create PLIC hart topology configuration string */
>      plic_hart_config_len = (strlen(SIFIVE_U_PLIC_HART_CONFIG) + 1) *
> --
> 2.21.1
>
>


  reply	other threads:[~2020-04-13 22:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 22:41 [PATCH-for-5.1 v3 00/23] various: Fix error-propagation with Coccinelle scripts (part 2) Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 01/23] scripts/coccinelle: Catch missing error_propagate() calls in realize() Philippe Mathieu-Daudé
2020-04-14 12:40   ` Markus Armbruster
2020-04-14 13:24     ` Markus Armbruster
2020-04-12 22:41 ` [PATCH-for-5.1 v3 02/23] hw/arm/fsl-imx: Add missing error-propagation code Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 03/23] hw/arm/stm32f*05_soc: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 04/23] hw/arm/aspeed: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 05/23] hw/arm/allwinner-a10: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 06/23] hw/arm/msf2-soc: " Philippe Mathieu-Daudé
2020-04-13 15:57   ` Alistair Francis
2020-04-12 22:41 ` [PATCH-for-5.1 v3 07/23] hw/riscv/sifive: " Philippe Mathieu-Daudé
2020-04-13 22:12   ` Alistair Francis [this message]
2020-04-12 22:41 ` [PATCH-for-5.1 v3 08/23] hw/arm/armv7m: " Philippe Mathieu-Daudé
2020-04-13 22:10   ` Alistair Francis
2020-04-12 22:41 ` [PATCH-for-5.1 v3 09/23] hw/intc/arm_gicv3_its_kvm: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 10/23] hw/microblaze/xlnx-zynqmp-pmu: " Philippe Mathieu-Daudé
2020-04-13 22:13   ` Alistair Francis
2020-04-12 22:41 ` [PATCH-for-5.1 v3 11/23] hw/pci-host/pnv_phb3: " Philippe Mathieu-Daudé
2020-04-14  2:12   ` David Gibson
2020-04-12 22:41 ` [PATCH-for-5.1 v3 12/23] hw/block/onenand: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 13/23] scripts/coccinelle: Add script to catch missing error_propagate() calls Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 14/23] hw/arm/bcm2835_peripherals: Add missing error-propagation code Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 15/23] hw/arm/fsl-imx: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 16/23] hw/arm/stm32fx05_soc: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 17/23] hw/dma/xilinx_axidma: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 18/23] hw/i386/x86: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 19/23] hw/mips/cps: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 20/23] hw/misc/macio/macio: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 21/23] hw/net/xilinx_axienet: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 22/23] hw/riscv/sifive_u: " Philippe Mathieu-Daudé
2020-04-12 22:41 ` [PATCH-for-5.1 v3 23/23] hw/sd/milkymist-memcard: " Philippe Mathieu-Daudé
2020-04-13  1:30 ` [PATCH-for-5.1 v3 00/23] various: Fix error-propagation with Coccinelle scripts (part 2) no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKmqyKNKw9hye2AaGocrKozyTA0xb-qDFB=yJ06iV+4xGT8-OA@mail.gmail.com' \
    --to=alistair23@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=aleksandar.rikalo@rt-rk.com \
    --cc=alistair@alistair23.me \
    --cc=andrew@aj.id.au \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=b.galvani@gmail.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=jasowang@redhat.com \
    --cc=jcd@tribudubois.net \
    --cc=joel@jms.id.au \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=kwolf@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=michael@walle.cc \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sagark@eecs.berkeley.edu \
    --cc=sundeep.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).