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>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <
20200610053247.
1583243-36-armbru@redhat.com>
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);
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);
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 */
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]);