[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize |
Date: |
Fri, 16 Feb 2024 12:03:08 +0100 |
When the QOM parent is available, prefer object_initialize_child()
over object_initialize(), since it create the parent relationship.
Rename the 'klass' variable as 'obj' since the argument holds a
reference to an instance object and not a class one.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/amd_iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 7329553ad3..c3afbc4130 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1616,11 +1616,11 @@ static const VMStateDescription vmstate_amdvi_sysbus = {
.unmigratable = 1
};
-static void amdvi_sysbus_instance_init(Object *klass)
+static void amdvi_sysbus_instance_init(Object *obj)
{
- AMDVIState *s = AMD_IOMMU_DEVICE(klass);
+ AMDVIState *s = AMD_IOMMU_DEVICE(obj);
- object_initialize(&s->pci, sizeof(s->pci), TYPE_AMD_IOMMU_PCI);
+ object_initialize_child(obj, "iommu", &s->pci, TYPE_AMD_IOMMU_PCI);
}
static void amdvi_sysbus_class_init(ObjectClass *klass, void *data)
--
2.41.0
- Re: [PATCH 10/21] hw/usb: Inline usb_new(), (continued)
- [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 12/21] hw/pci-host/q35: Update q35_host_props[] comment, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 13/21] hw/pci-host/raven: Embedded OrIRQ in PRePPCIState, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 14/21] hw/pci-host/raven: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 16/21] hw/net/can/versal: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 15/21] hw/core/register: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize,
Philippe Mathieu-Daudé <=
- [PATCH 19/21] hw/s390x/zpci-bus: Add QOM parentship relation with zPCI devices, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 18/21] hw/pci-host/versatile: Replace object_initialize() -> _child(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 20/21] hw/arm/mps2: Add QOM parentship relation with OR IRQ gates, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 21/21] hw: Add QOM parentship relation with CPUs, Philippe Mathieu-Daudé, 2024/02/16