diff mbox series

hw/isa/isa-superio: Set abstract TYPE_ISA_SUPERIO instance size

Message ID 20200821173831.1262979-1-philmd@redhat.com
State New
Headers show
Series hw/isa/isa-superio: Set abstract TYPE_ISA_SUPERIO instance size | expand

Commit Message

Philippe Mathieu-Daudé Aug. 21, 2020, 5:38 p.m. UTC
Instead of setting the instance size on each implementations,
set it on the abstract parent, so we are sure no implementation
will forget to set it.

Reported-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
See:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg731954.html
---
 hw/isa/isa-superio.c       | 2 +-
 hw/isa/smc37c669-superio.c | 1 -
 hw/isa/vt82c686.c          | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index e2e47d8fd99..83eb21ebb2a 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -182,6 +182,7 @@  static const TypeInfo isa_superio_type_info = {
     .name = TYPE_ISA_SUPERIO,
     .parent = TYPE_ISA_DEVICE,
     .abstract = true,
+    .instance_size = sizeof(ISASuperIODevice),
     .class_size = sizeof(ISASuperIOClass),
     .class_init = isa_superio_class_init,
 };
@@ -200,7 +201,6 @@  static void fdc37m81x_class_init(ObjectClass *klass, void *data)
 static const TypeInfo fdc37m81x_type_info = {
     .name          = TYPE_FDC37M81X_SUPERIO,
     .parent        = TYPE_ISA_SUPERIO,
-    .instance_size = sizeof(ISASuperIODevice),
     .class_init    = fdc37m81x_class_init,
 };
 
diff --git a/hw/isa/smc37c669-superio.c b/hw/isa/smc37c669-superio.c
index 18287741cb4..9e59dc16039 100644
--- a/hw/isa/smc37c669-superio.c
+++ b/hw/isa/smc37c669-superio.c
@@ -103,7 +103,6 @@  static void smc37c669_class_init(ObjectClass *klass, void *data)
 static const TypeInfo smc37c669_type_info = {
     .name          = TYPE_SMC37C669_SUPERIO,
     .parent        = TYPE_ISA_SUPERIO,
-    .instance_size = sizeof(ISASuperIODevice),
     .class_size    = sizeof(ISASuperIOClass),
     .class_init    = smc37c669_class_init,
 };
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 18160ca445d..a4b84d405d0 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -533,7 +533,6 @@  static void vt82c686b_superio_class_init(ObjectClass *klass, void *data)
 static const TypeInfo via_superio_info = {
     .name          = TYPE_VT82C686B_SUPERIO,
     .parent        = TYPE_ISA_SUPERIO,
-    .instance_size = sizeof(ISASuperIODevice),
     .class_size    = sizeof(ISASuperIOClass),
     .class_init    = vt82c686b_superio_class_init,
 };