[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 35/58] qom: Tidy up a few object_initialize_child() calls
From: |
Markus Armbruster |
Subject: |
[PATCH v2 35/58] qom: Tidy up a few object_initialize_child() calls |
Date: |
Fri, 29 May 2020 15:45:00 +0200 |
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 <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
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 9c25d5da96..296057b1ab 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -268,7 +268,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.3
- [PATCH v2 14/58] hw/ppc: Eliminate two superfluous QOM casts, (continued)
- [PATCH v2 14/58] hw/ppc: Eliminate two superfluous QOM casts, Markus Armbruster, 2020/05/29
- [PATCH v2 30/58] qdev: qdev_create(), qdev_try_create() are now unused, drop, Markus Armbruster, 2020/05/29
- [PATCH v2 12/58] qdev: Convert uses of qdev_set_parent_bus() manually, Markus Armbruster, 2020/05/29
- [PATCH v2 19/58] isa: Convert uses of isa_create() with Coccinelle, Markus Armbruster, 2020/05/29
- [PATCH v2 21/58] isa: isa_create(), isa_try_create() are now unused, drop, Markus Armbruster, 2020/05/29
- [PATCH v2 22/58] ssi: ssi_auto_connect_slaves() never does anything, drop, Markus Armbruster, 2020/05/29
- [PATCH v2 31/58] auxbus: Rename aux_init_bus() to aux_bus_init(), Markus Armbruster, 2020/05/29
- [PATCH v2 34/58] auxbus: Eliminate aux_create_slave(), Markus Armbruster, 2020/05/29
- [PATCH v2 38/58] macio: Eliminate macio_init_child_obj(), Markus Armbruster, 2020/05/29
- [PATCH v2 32/58] auxbus: New aux_bus_realize(), pairing with aux_bus_init(), Markus Armbruster, 2020/05/29
- [PATCH v2 35/58] qom: Tidy up a few object_initialize_child() calls,
Markus Armbruster <=
- [PATCH v2 33/58] auxbus: Convert a use of qdev_set_parent_bus(), Markus Armbruster, 2020/05/29
- [PATCH v2 15/58] pci: Convert uses of pci_create() etc. with Coccinelle, Markus Armbruster, 2020/05/29
- [PATCH v2 37/58] macio: Convert use of qdev_set_parent_bus(), Markus Armbruster, 2020/05/29
- [PATCH v2 42/58] hw/arm/armsse: Pass correct child size to sysbus_init_child_obj(), Markus Armbruster, 2020/05/29
- [PATCH v2 41/58] sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1, Markus Armbruster, 2020/05/29
- [PATCH v2 39/58] sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls, Markus Armbruster, 2020/05/29
- [PATCH v2 40/58] microbit: Tidy up sysbus_init_child_obj() @child argument, Markus Armbruster, 2020/05/29
- [PATCH v2 17/58] pci: pci_create(), pci_create_multifunction() are now unused, drop, Markus Armbruster, 2020/05/29
- [PATCH v2 24/58] ssi: Convert last use of ssi_create_slave_no_init() manually, Markus Armbruster, 2020/05/29
- [PATCH v2 46/58] qdev: Drop qdev_realize() support for null bus, Markus Armbruster, 2020/05/29