spapr: Remove unnecessary instance_size specifications from DRC subtypes
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 <david@gibson.dropbear.id.au>
This commit is contained in:
parent
4871b51b92
commit
3579d606a0
|
@ -653,7 +653,6 @@ static const TypeInfo spapr_dr_connector_info = {
|
||||||
static const TypeInfo spapr_drc_physical_info = {
|
static const TypeInfo spapr_drc_physical_info = {
|
||||||
.name = TYPE_SPAPR_DRC_PHYSICAL,
|
.name = TYPE_SPAPR_DRC_PHYSICAL,
|
||||||
.parent = TYPE_SPAPR_DR_CONNECTOR,
|
.parent = TYPE_SPAPR_DR_CONNECTOR,
|
||||||
.instance_size = sizeof(sPAPRDRConnector),
|
|
||||||
.class_init = spapr_drc_physical_class_init,
|
.class_init = spapr_drc_physical_class_init,
|
||||||
.abstract = true,
|
.abstract = true,
|
||||||
};
|
};
|
||||||
|
@ -661,7 +660,6 @@ static const TypeInfo spapr_drc_physical_info = {
|
||||||
static const TypeInfo spapr_drc_logical_info = {
|
static const TypeInfo spapr_drc_logical_info = {
|
||||||
.name = TYPE_SPAPR_DRC_LOGICAL,
|
.name = TYPE_SPAPR_DRC_LOGICAL,
|
||||||
.parent = TYPE_SPAPR_DR_CONNECTOR,
|
.parent = TYPE_SPAPR_DR_CONNECTOR,
|
||||||
.instance_size = sizeof(sPAPRDRConnector),
|
|
||||||
.class_init = spapr_drc_logical_class_init,
|
.class_init = spapr_drc_logical_class_init,
|
||||||
.abstract = true,
|
.abstract = true,
|
||||||
};
|
};
|
||||||
|
@ -669,21 +667,18 @@ static const TypeInfo spapr_drc_logical_info = {
|
||||||
static const TypeInfo spapr_drc_cpu_info = {
|
static const TypeInfo spapr_drc_cpu_info = {
|
||||||
.name = TYPE_SPAPR_DRC_CPU,
|
.name = TYPE_SPAPR_DRC_CPU,
|
||||||
.parent = TYPE_SPAPR_DRC_LOGICAL,
|
.parent = TYPE_SPAPR_DRC_LOGICAL,
|
||||||
.instance_size = sizeof(sPAPRDRConnector),
|
|
||||||
.class_init = spapr_drc_cpu_class_init,
|
.class_init = spapr_drc_cpu_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const TypeInfo spapr_drc_pci_info = {
|
static const TypeInfo spapr_drc_pci_info = {
|
||||||
.name = TYPE_SPAPR_DRC_PCI,
|
.name = TYPE_SPAPR_DRC_PCI,
|
||||||
.parent = TYPE_SPAPR_DRC_PHYSICAL,
|
.parent = TYPE_SPAPR_DRC_PHYSICAL,
|
||||||
.instance_size = sizeof(sPAPRDRConnector),
|
|
||||||
.class_init = spapr_drc_pci_class_init,
|
.class_init = spapr_drc_pci_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const TypeInfo spapr_drc_lmb_info = {
|
static const TypeInfo spapr_drc_lmb_info = {
|
||||||
.name = TYPE_SPAPR_DRC_LMB,
|
.name = TYPE_SPAPR_DRC_LMB,
|
||||||
.parent = TYPE_SPAPR_DRC_LOGICAL,
|
.parent = TYPE_SPAPR_DRC_LOGICAL,
|
||||||
.instance_size = sizeof(sPAPRDRConnector),
|
|
||||||
.class_init = spapr_drc_lmb_class_init,
|
.class_init = spapr_drc_lmb_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue