[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.1 v2 06/54] hw/arm/aspeed_soc: Move some code from real
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH-for-5.1 v2 06/54] hw/arm/aspeed_soc: Move some code from realize() to init() |
Date: |
Tue, 7 Apr 2020 08:47:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 4/6/20 7:46 PM, Philippe Mathieu-Daudé wrote:
> Coccinelle reported:
>
> $ spatch ... --timeout 60 --sp-file \
> scripts/coccinelle/simplify-init-realize-error_propagate.cocci
> HANDLING: ./hw/arm/aspeed_soc.c
> >>> possible moves from aspeed_soc_init() to aspeed_soc_realize() in
> ./hw/arm/aspeed_soc.c:231
>
> Move the calls using &error_fatal which don't depend of input
> updated before realize() to init().
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Thanks,
C.
> ---
> hw/arm/aspeed_soc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index 696c7fda14..debd7c8faa 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -183,6 +183,7 @@ static void aspeed_soc_init(Object *obj)
> snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1,
> socname);
> sysbus_init_child_obj(obj, "spi[*]", OBJECT(&s->spi[i]),
> sizeof(s->spi[i]), typename);
> + object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs",
> &error_abort);
> }
>
> for (i = 0; i < sc->ehcis_num; i++) {
> @@ -360,10 +361,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error
> **errp)
>
> /* SPI */
> for (i = 0; i < sc->spis_num; i++) {
> - object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs", &err);
> - object_property_set_bool(OBJECT(&s->spi[i]), true, "realized",
> - &local_err);
> - error_propagate(&err, local_err);
> + object_property_set_bool(OBJECT(&s->spi[i]), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> return;
>
- Re: [PATCH-for-5.1 v2 01/54] various: Remove suspicious '\' character outside of #define in C code, (continued)
- [PATCH-for-5.1 v2 05/54] hw/arm/aspeed_ast2600: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 07/54] hw/arm/aspeed_soc: Simplify use of Error*, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 09/54] hw/arm/fsl-imx6: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 08/54] hw/arm/fsl-imx6: Simplify checks on 'smp_cpus' count, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 10/54] hw/arm/fsl-imx31: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 13/54] hw/arm/stm32f205_soc: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 11/54] hw/arm/msf2-soc: Store MemoryRegion in MSF2State, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 06/54] hw/arm/aspeed_soc: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- Re: [PATCH-for-5.1 v2 06/54] hw/arm/aspeed_soc: Move some code from realize() to init(),
Cédric Le Goater <=
- [PATCH-for-5.1 v2 15/54] hw/arm/xlnx-zynqmp: Split xlnx_zynqmp_create_rpu() as init + realize, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 14/54] hw/arm/xlnx-zynqmp: Use single propagate_error() call, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 18/54] hw/pci-host/pnv_phb3: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 19/54] hw/riscv/sifive_e: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 20/54] hw/riscv/sifive_u: Use single type_init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 16/54] hw/arm/xlnx-zynqmp: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 17/54] hw/microblaze/xlnx-zynqmp-pmu: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 12/54] hw/arm/stm32f205_soc: Store MemoryRegion in STM32F205State, Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 21/54] hw/riscv/sifive_u: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/06
- [PATCH-for-5.1 v2 22/54] hw/riscv/sifive_u: Store MemoryRegion in SiFiveUSoCState, Philippe Mathieu-Daudé, 2020/04/06