hw/nvram: Simplify memory_region_init_rom_device() calls
commitca1b8762922f4fa859e082898ca567c2cc0269ca
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 20 Nov 2023 12:42:00 +0000 (20 13:42 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 5 Jan 2024 15:20:15 +0000 (5 16:20 +0100)
tree6230daa2fcac0a261bea95ee0321001d516c2c7b
parent7493bd184e35e88317d306e4df030459eefc7ed9
hw/nvram: Simplify memory_region_init_rom_device() calls

Mechanical change using the following coccinelle script:

@@
expression mr, owner, arg3, arg4, arg5, arg6, errp;
@@
-   memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp);
    if (
-       errp
+       !memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &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-25-philmd@linaro.org>
hw/nvram/nrf51_nvm.c