[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 01/21] spapr: Remove unnecessary instance_size specific
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 01/21] spapr: Remove unnecessary instance_size specifications from DRC subtypes |
Date: |
Mon, 17 Jul 2017 16:56:01 +1000 |
All the DRC subtypes explicitly list instance_size in TypeInfo (all as
sizeof(sPAPRDRConnector). This isn't necessary, since if it's not listed
it will be derived from the parent type.
Worse, this is dangerous, because if a subtype is changed in future to
have a larger structure, then subtypes of that subtype also need to have
instance_size changed, or it will lead to hard to track memory corruption
bugs.
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_drc.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index f34355dad1..7f71c77015 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -653,7 +653,6 @@ static const TypeInfo spapr_dr_connector_info = {
static const TypeInfo spapr_drc_physical_info = {
.name = TYPE_SPAPR_DRC_PHYSICAL,
.parent = TYPE_SPAPR_DR_CONNECTOR,
- .instance_size = sizeof(sPAPRDRConnector),
.class_init = spapr_drc_physical_class_init,
.abstract = true,
};
@@ -661,7 +660,6 @@ static const TypeInfo spapr_drc_physical_info = {
static const TypeInfo spapr_drc_logical_info = {
.name = TYPE_SPAPR_DRC_LOGICAL,
.parent = TYPE_SPAPR_DR_CONNECTOR,
- .instance_size = sizeof(sPAPRDRConnector),
.class_init = spapr_drc_logical_class_init,
.abstract = true,
};
@@ -669,21 +667,18 @@ static const TypeInfo spapr_drc_logical_info = {
static const TypeInfo spapr_drc_cpu_info = {
.name = TYPE_SPAPR_DRC_CPU,
.parent = TYPE_SPAPR_DRC_LOGICAL,
- .instance_size = sizeof(sPAPRDRConnector),
.class_init = spapr_drc_cpu_class_init,
};
static const TypeInfo spapr_drc_pci_info = {
.name = TYPE_SPAPR_DRC_PCI,
.parent = TYPE_SPAPR_DRC_PHYSICAL,
- .instance_size = sizeof(sPAPRDRConnector),
.class_init = spapr_drc_pci_class_init,
};
static const TypeInfo spapr_drc_lmb_info = {
.name = TYPE_SPAPR_DRC_LMB,
.parent = TYPE_SPAPR_DRC_LOGICAL,
- .instance_size = sizeof(sPAPRDRConnector),
.class_init = spapr_drc_lmb_class_init,
};
--
2.13.3
- [Qemu-ppc] [PULL 00/21] ppc-for-2.10 queue 20170717, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 04/21] spapr: Treat devices added before inbound migration as coldplugged, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 20/21] spapr: fix memory leak in spapr_core_pre_plug(), David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 07/21] spapr: Abort on delete failure in spapr_drc_release(), David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 05/21] spapr: Remove 'awaiting_allocation' DRC flag, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 01/21] spapr: Remove unnecessary instance_size specifications from DRC subtypes,
David Gibson <=
- [Qemu-ppc] [PULL 09/21] spapr: Cleanups relating to DRC awaiting_release field, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 12/21] spapr: Implement DR-indicator for physical DRCs only, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 19/21] pseries: Allow HPT resizing with KVM, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 06/21] spapr: Simplify unplug path, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 02/21] spapr: migrate pending_events of spapr state, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 08/21] spapr: Refactor spapr_drc_detach(), David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 03/21] spapr: Minor cleanups to events handling, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 17/21] pseries: Enable HPT resizing for 2.10, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 13/21] spapr: fix potential memory leak in spapr_core_plug(), David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 21/21] target/ppc: fix CPU hotplug when radix is enabled (TCG), David Gibson, 2017/07/17