diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-11-20 13:36:35 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-05 16:20:15 +0100 |
| commit | 2198f5f0f2f3f5470a9e3c0c1431dec022bb67ad (patch) | |
| tree | ab84e79866de9510d46ca5e8ae18fa18a6e6ee68 /hw/arm/fsl-imx6.c | |
| parent | 9c878ad6fbfc7934c9c4f6ba607c0842202afdbb (diff) | |
| download | focaccia-qemu-2198f5f0f2f3f5470a9e3c0c1431dec022bb67ad.tar.gz focaccia-qemu-2198f5f0f2f3f5470a9e3c0c1431dec022bb67ad.zip | |
hw: Simplify memory_region_init_ram() calls
Mechanical change using the following coccinelle script:
@@
expression mr, owner, arg3, arg4, errp;
@@
- memory_region_init_ram(mr, owner, arg3, arg4, &errp);
if (
- errp
+ !memory_region_init_ram(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: Andrew Jeffery <andrew@codeconstruct.com.au> # aspeed
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20231120213301.24349-21-philmd@linaro.org>
Diffstat (limited to 'hw/arm/fsl-imx6.c')
| -rw-r--r-- | hw/arm/fsl-imx6.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 7dc42cbfe6..58f37e7c11 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -443,10 +443,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) &s->caam); /* OCRAM memory */ - memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_SIZE, - &err); - if (err) { - error_propagate(errp, err); + if (!memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", + FSL_IMX6_OCRAM_SIZE, errp)) { return; } memory_region_add_subregion(get_system_memory(), FSL_IMX6_OCRAM_ADDR, |