[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error*
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error* |
Date: |
Tue, 7 Apr 2020 08:47:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 4/6/20 7:46 PM, Philippe Mathieu-Daudé wrote:
> In the previous commit we noticed we don't need two different
> Error*, drop the one less used.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
It seems that the 'return' are badly aligned ?
Thanks,
C.
> ---
> hw/arm/aspeed_soc.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index debd7c8faa..aa6d739ad0 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -234,7 +234,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error
> **errp)
> int i;
> AspeedSoCState *s = ASPEED_SOC(dev);
> AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
> - Error *err = NULL, *local_err = NULL;
> + Error *err = NULL;
>
> /* IO space */
> create_unimplemented_device("aspeed_soc.io", sc->memmap[ASPEED_IOMEM],
> @@ -413,9 +413,12 @@ static void aspeed_soc_realize(DeviceState *dev, Error
> **errp)
> qdev_set_nic_properties(DEVICE(&s->ftgmac100[i]), &nd_table[i]);
> object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed",
> &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "realized",
> - &local_err);
> - error_propagate(&err, local_err);
> + &err);
> if (err) {
> error_propagate(errp, err);
> return;
>