[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] hw/arm/armsse: Convert armsse_realize() to use ERRP_GUARD
From: |
Peter Maydell |
Subject: |
[PATCH 4/6] hw/arm/armsse: Convert armsse_realize() to use ERRP_GUARD |
Date: |
Mon, 10 May 2021 20:08:42 +0100 |
Convert armsse_realize() to use ERRP_GUARD(), following
the rules in include/qapi/error.h.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
We'll be adding a new error check in the next patch, so
do this first to avoid adding more uses of legacy
error_propagate().
---
hw/arm/armsse.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 1729f09c7cb..be5aa1f113a 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -913,7 +913,6 @@ static void armsse_realize(DeviceState *dev, Error **errp)
const ARMSSEDeviceInfo *devinfo;
int i;
MemoryRegion *mr;
- Error *err = NULL;
SysBusDevice *sbd_apb_ppc0;
SysBusDevice *sbd_secctl;
DeviceState *dev_apb_ppc0;
@@ -922,6 +921,8 @@ static void armsse_realize(DeviceState *dev, Error **errp)
DeviceState *dev_splitter;
uint32_t addr_width_max;
+ ERRP_GUARD();
+
if (!s->board_memory) {
error_setg(errp, "memory property was not set");
return;
@@ -1151,10 +1152,9 @@ static void armsse_realize(DeviceState *dev, Error
**errp)
uint32_t sram_bank_size = 1 << s->sram_addr_width;
memory_region_init_ram(&s->sram[i], NULL, ramname,
- sram_bank_size, &err);
+ sram_bank_size, errp);
g_free(ramname);
- if (err) {
- error_propagate(errp, err);
+ if (*errp) {
return;
}
object_property_set_link(OBJECT(&s->mpc[i]), "downstream",
--
2.20.1
- [PATCH 0/6] hw/arm: Fix modelling of SSE-300 TCMs and SRAM, Peter Maydell, 2021/05/10
- [PATCH 2/6] hw/arm/mps2-tz: Make SRAM_ADDR_WIDTH board-specific, Peter Maydell, 2021/05/10
- [PATCH 1/6] hw/arm/mps2-tz: Don't duplicate modelling of SRAM in AN524, Peter Maydell, 2021/05/10
- [PATCH 4/6] hw/arm/armsse: Convert armsse_realize() to use ERRP_GUARD,
Peter Maydell <=
- [PATCH 5/6] hw/arm/mps2-tz: Allow board to specify a boot RAM size, Peter Maydell, 2021/05/10
- [PATCH 3/6] hw/arm/armsse.c: Correct modelling of SSE-300 internal SRAMs, Peter Maydell, 2021/05/10
- [PATCH 6/6] hw/arm: Model TCMs in the SSE-300, not the AN547, Peter Maydell, 2021/05/10
- Re: [PATCH 0/6] hw/arm: Fix modelling of SSE-300 TCMs and SRAM, Philippe Mathieu-Daudé, 2021/05/10