[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error*
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error* |
Date: |
Mon, 6 Apr 2020 19:46:56 +0200 |
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>
---
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;
--
2.21.1
- [PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error*,
Philippe Mathieu-Daudé <=