diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-11-20 13:36:49 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-05 16:20:15 +0100 |
commit | 419d8524a266ece5ea44e689174ab026df888d08 (patch) | |
tree | c80a2080ef17c744749535bb7568f2e5c7118a0d /hw/arm/fsl-imx6.c | |
parent | 2198f5f0f2f3f5470a9e3c0c1431dec022bb67ad (diff) | |
download | qemu-419d8524a266ece5ea44e689174ab026df888d08.zip qemu-419d8524a266ece5ea44e689174ab026df888d08.tar.gz qemu-419d8524a266ece5ea44e689174ab026df888d08.tar.bz2 |
hw/arm: Simplify memory_region_init_rom() calls
Mechanical change using the following coccinelle script:
@@
expression mr, owner, arg3, arg4, errp;
@@
- memory_region_init_rom(mr, owner, arg3, arg4, &errp);
if (
- errp
+ !memory_region_init_rom(mr, owner, arg3, arg4, &errp)
) {
...
return;
}
and removing the local Error variable.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20231120213301.24349-22-philmd@linaro.org>
Diffstat (limited to 'hw/arm/fsl-imx6.c')
-rw-r--r-- | hw/arm/fsl-imx6.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 58f37e7..b215302 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -109,7 +109,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) MachineState *ms = MACHINE(qdev_get_machine()); FslIMX6State *s = FSL_IMX6(dev); uint16_t i; - Error *err = NULL; unsigned int smp_cpus = ms->smp.cpus; if (smp_cpus > FSL_IMX6_NUM_CPUS) { @@ -423,20 +422,16 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) } /* ROM memory */ - memory_region_init_rom(&s->rom, OBJECT(dev), "imx6.rom", - FSL_IMX6_ROM_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->rom, OBJECT(dev), "imx6.rom", + FSL_IMX6_ROM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX6_ROM_ADDR, &s->rom); /* CAAM memory */ - memory_region_init_rom(&s->caam, OBJECT(dev), "imx6.caam", - FSL_IMX6_CAAM_MEM_SIZE, &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_rom(&s->caam, OBJECT(dev), "imx6.caam", + FSL_IMX6_CAAM_MEM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX6_CAAM_MEM_ADDR, |