diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-11-20 13:23:33 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-05 16:20:15 +0100 |
commit | 02e0ecb42ccbf750bb60f82c23ef25540ad12b20 (patch) | |
tree | a6c17dfb54c545a236680a78baef4cfdb8c3eec1 /hw/sparc64 | |
parent | 419d8524a266ece5ea44e689174ab026df888d08 (diff) | |
download | qemu-02e0ecb42ccbf750bb60f82c23ef25540ad12b20.zip qemu-02e0ecb42ccbf750bb60f82c23ef25540ad12b20.tar.gz qemu-02e0ecb42ccbf750bb60f82c23ef25540ad12b20.tar.bz2 |
hw/sparc: Simplify memory_region_init_ram_nomigrate() calls
Mechanical change using the following coccinelle script:
@@
expression mr, owner, arg3, arg4, errp;
@@
- memory_region_init_ram_nomigrate(mr, owner, arg3, arg4, &errp);
if (
- errp
+ !memory_region_init_ram_nomigrate(mr, owner, arg3, arg4, &errp)
) {
...
return;
}
and removing the local Error variable.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20231120213301.24349-23-philmd@linaro.org>
Diffstat (limited to 'hw/sparc64')
-rw-r--r-- | hw/sparc64/sun4u.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index c871170..24d53bf 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -454,12 +454,9 @@ static void prom_realize(DeviceState *ds, Error **errp) { PROMState *s = OPENPROM(ds); SysBusDevice *dev = SYS_BUS_DEVICE(ds); - Error *local_err = NULL; - memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4u.prom", - PROM_SIZE_MAX, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!memory_region_init_ram_nomigrate(&s->prom, OBJECT(ds), "sun4u.prom", + PROM_SIZE_MAX, errp)) { return; } |