[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.1 v2 28/54] hw/arm/aspeed: Add missing error-propagatio
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH-for-5.1 v2 28/54] hw/arm/aspeed: Add missing error-propagation code |
Date: |
Tue, 7 Apr 2020 08:47:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 4/6/20 7:47 PM, Philippe Mathieu-Daudé 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é <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
The 'return' are correct this time.
Thanks,
C.
> ---
> hw/arm/aspeed_ast2600.c | 36 ++++++++++++++++++++++++++++++------
> hw/arm/aspeed_soc.c | 12 ++++++++++--
> 2 files changed, 40 insertions(+), 8 deletions(-)
>
> diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
> index c8e0171824..d810df928c 100644
> --- a/hw/arm/aspeed_ast2600.c
> +++ b/hw/arm/aspeed_ast2600.c
> @@ -277,7 +277,11 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
> Error **errp)
> if (s->num_cpus > 1) {
> object_property_set_int(OBJECT(&s->cpu[i]),
> ASPEED_A7MPCORE_ADDR,
> - "reset-cbar", &error_abort);
> + "reset-cbar", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> }
> /*
> * TODO: the secondary CPUs are started and a boot helper
> @@ -293,10 +297,18 @@ static void aspeed_soc_ast2600_realize(DeviceState
> *dev, Error **errp)
>
> /* A7MPCORE */
> object_property_set_int(OBJECT(&s->a7mpcore), s->num_cpus, "num-cpu",
> - &error_abort);
> + &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
>
> object_property_set_bool(OBJECT(&s->a7mpcore), true, "realized",
> - &error_abort);
> + &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, ASPEED_A7MPCORE_ADDR);
>
> for (i = 0; i < s->num_cpus; i++) {
> @@ -343,7 +355,11 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
> Error **errp)
>
> /* Timer */
> object_property_set_link(OBJECT(&s->timerctrl),
> - OBJECT(&s->scu), "scu", &error_abort);
> + OBJECT(&s->scu), "scu", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> object_property_set_bool(OBJECT(&s->timerctrl), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> @@ -459,7 +475,11 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
> Error **errp)
> AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
>
> object_property_set_link(OBJECT(&s->wdt[i]),
> - OBJECT(&s->scu), "scu", &error_abort);
> + OBJECT(&s->scu), "scu", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> @@ -490,7 +510,11 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev,
> Error **errp)
> aspeed_soc_get_irq(s, ASPEED_ETH1 + i));
>
> object_property_set_link(OBJECT(&s->mii[i]),
> OBJECT(&s->ftgmac100[i]),
> - "nic", &error_abort);
> + "nic", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> object_property_set_bool(OBJECT(&s->mii[i]), true, "realized",
> &err);
> if (err) {
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index aa6d739ad0..5f90215187 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -301,7 +301,11 @@ static void aspeed_soc_realize(DeviceState *dev, Error
> **errp)
>
> /* Timer */
> object_property_set_link(OBJECT(&s->timerctrl),
> - OBJECT(&s->scu), "scu", &error_abort);
> + OBJECT(&s->scu), "scu", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> object_property_set_bool(OBJECT(&s->timerctrl), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> @@ -398,7 +402,11 @@ static void aspeed_soc_realize(DeviceState *dev, Error
> **errp)
> AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
>
> object_property_set_link(OBJECT(&s->wdt[i]),
> - OBJECT(&s->scu), "scu", &error_abort);
> + OBJECT(&s->scu), "scu", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
>