[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 33/55] qom: Tidy up a few object_initialize_child() calls
From: |
Alistair Francis |
Subject: |
Re: [PATCH 33/55] qom: Tidy up a few object_initialize_child() calls |
Date: |
Tue, 19 May 2020 14:14:31 -0700 |
On Tue, May 19, 2020 at 8:04 AM Markus Armbruster <address@hidden> wrote:
>
> The callers of object_initialize_child() commonly pass either
> &child, sizeof(child), or pchild, sizeof(*pchild). Tidy up the few
> that don't, mostly to keep the next commit simpler.
>
> Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> hw/arm/aspeed.c | 2 +-
> hw/microblaze/xlnx-zynqmp-pmu.c | 3 +--
> hw/pci-host/pnv_phb4.c | 2 +-
> hw/riscv/riscv_hart.c | 2 +-
> 4 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index adbfbbd6b4..eaf50da8df 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -267,7 +267,7 @@ static void aspeed_machine_init(MachineState *machine)
> memory_region_add_subregion(&bmc->ram_container, 0, machine->ram);
>
> object_initialize_child(OBJECT(machine), "soc", &bmc->soc,
> - (sizeof(bmc->soc)), amc->soc_name, &error_abort,
> + sizeof(bmc->soc), amc->soc_name, &error_abort,
> NULL);
>
> sc = ASPEED_SOC_GET_CLASS(&bmc->soc);
> diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c
> index 028f31894d..aa90b9d1be 100644
> --- a/hw/microblaze/xlnx-zynqmp-pmu.c
> +++ b/hw/microblaze/xlnx-zynqmp-pmu.c
> @@ -174,8 +174,7 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
> pmu_ram);
>
> /* Create the PMU device */
> - object_initialize_child(OBJECT(machine), "pmu", pmu,
> - sizeof(XlnxZynqMPPMUSoCState),
> + object_initialize_child(OBJECT(machine), "pmu", pmu, sizeof(*pmu),
> TYPE_XLNX_ZYNQMP_PMU_SOC, &error_abort, NULL);
> object_property_set_bool(OBJECT(pmu), true, "realized", &error_fatal);
>
> diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
> index e30ae9ad5b..aba710fd1f 100644
> --- a/hw/pci-host/pnv_phb4.c
> +++ b/hw/pci-host/pnv_phb4.c
> @@ -1155,7 +1155,7 @@ static void pnv_phb4_instance_init(Object *obj)
> QLIST_INIT(&phb->dma_spaces);
>
> /* XIVE interrupt source object */
> - object_initialize_child(obj, "source", &phb->xsrc, sizeof(XiveSource),
> + object_initialize_child(obj, "source", &phb->xsrc, sizeof(phb->xsrc),
> TYPE_XIVE_SOURCE, &error_abort, NULL);
>
> /* Root Port */
> diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c
> index 276a9baca0..61e88e2e37 100644
> --- a/hw/riscv/riscv_hart.c
> +++ b/hw/riscv/riscv_hart.c
> @@ -46,7 +46,7 @@ static void riscv_hart_realize(RISCVHartArrayState *s, int
> idx,
> Error *err = NULL;
>
> object_initialize_child(OBJECT(s), "harts[*]", &s->harts[idx],
> - sizeof(RISCVCPU), cpu_type,
> + sizeof(s->harts[idx]), cpu_type,
> &error_abort, NULL);
> s->harts[idx].env.mhartid = s->hartid_base + idx;
> qemu_register_reset(riscv_harts_cpu_reset, &s->harts[idx]);
> --
> 2.21.1
>
>
- [PATCH 31/55] auxbus: Convert a use of qdev_set_parent_bus(), (continued)
- [PATCH 31/55] auxbus: Convert a use of qdev_set_parent_bus(), Markus Armbruster, 2020/05/19
- [PATCH 23/55] ssi: Convert last use of ssi_create_slave_no_init() manually, Markus Armbruster, 2020/05/19
- [PATCH 30/55] auxbus: New aux_realize_bus(), pairing with aux_init_bus(), Markus Armbruster, 2020/05/19
- [PATCH 11/55] qdev: Convert uses of qdev_set_parent_bus() manually, Markus Armbruster, 2020/05/19
- [PATCH 32/55] auxbus: Eliminate aux_create_slave(), Markus Armbruster, 2020/05/19
- [PATCH 18/55] isa: Convert uses of isa_create() with Coccinelle, Markus Armbruster, 2020/05/19
- [PATCH 33/55] qom: Tidy up a few object_initialize_child() calls, Markus Armbruster, 2020/05/19
- [PATCH 12/55] pci: New pci_new(), pci_realize_and_unref() etc., Markus Armbruster, 2020/05/19
- [PATCH 38/55] microbit: Tidy up sysbus_init_child_obj() @child argument, Markus Armbruster, 2020/05/19
- [PATCH 16/55] pci: pci_create(), pci_create_multifunction() are now unused, drop, Markus Armbruster, 2020/05/19
- [PATCH 24/55] ssi: ssi_create_slave_no_init() is now unused, drop, Markus Armbruster, 2020/05/19
- [PATCH 10/55] qdev: Convert uses of qdev_set_parent_bus() with Coccinelle, Markus Armbruster, 2020/05/19