2
0
Эх сурвалжийг харах

hw/isa: Remove empty ISADeviceClass structure

ISADeviceClass is an empty class and just increase code
complexity. Remove it, directly embedding DeviceClass in
classes expanding TYPE_ISA_DEVICE.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Message-Id: <20230215161641.32663-19-philmd@linaro.org>
Philippe Mathieu-Daudé 2 жил өмнө
parent
commit
97cfb5e430

+ 0 - 1
hw/isa/isa-bus.c

@@ -213,7 +213,6 @@ static const TypeInfo isa_device_type_info = {
     .parent = TYPE_DEVICE,
     .parent = TYPE_DEVICE,
     .instance_size = sizeof(ISADevice),
     .instance_size = sizeof(ISADevice),
     .abstract = true,
     .abstract = true,
-    .class_size = sizeof(ISADeviceClass),
     .class_init = isa_device_class_init,
     .class_init = isa_device_class_init,
 };
 };
 
 

+ 1 - 1
hw/rtc/m48t59-isa.c

@@ -47,7 +47,7 @@ struct M48txxISAState {
 };
 };
 
 
 struct M48txxISADeviceClass {
 struct M48txxISADeviceClass {
-    ISADeviceClass parent_class;
+    DeviceClass parent_class;
     M48txxInfo info;
     M48txxInfo info;
 };
 };
 
 

+ 1 - 1
include/hw/isa/i8259_internal.h

@@ -35,7 +35,7 @@
 OBJECT_DECLARE_TYPE(PICCommonState, PICCommonClass, PIC_COMMON)
 OBJECT_DECLARE_TYPE(PICCommonState, PICCommonClass, PIC_COMMON)
 
 
 struct PICCommonClass {
 struct PICCommonClass {
-    ISADeviceClass parent_class;
+    DeviceClass parent_class;
 
 
     void (*pre_save)(PICCommonState *s);
     void (*pre_save)(PICCommonState *s);
     void (*post_load)(PICCommonState *s);
     void (*post_load)(PICCommonState *s);

+ 1 - 5
include/hw/isa/isa.h

@@ -11,7 +11,7 @@
 #define ISA_NUM_IRQS 16
 #define ISA_NUM_IRQS 16
 
 
 #define TYPE_ISA_DEVICE "isa-device"
 #define TYPE_ISA_DEVICE "isa-device"
-OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE)
+OBJECT_DECLARE_SIMPLE_TYPE(ISADevice, ISA_DEVICE)
 
 
 #define TYPE_ISA_BUS "ISA"
 #define TYPE_ISA_BUS "ISA"
 OBJECT_DECLARE_SIMPLE_TYPE(ISABus, ISA_BUS)
 OBJECT_DECLARE_SIMPLE_TYPE(ISABus, ISA_BUS)
@@ -48,10 +48,6 @@ struct IsaDmaClass {
                              void *opaque);
                              void *opaque);
 };
 };
 
 
-struct ISADeviceClass {
-    DeviceClass parent_class;
-};
-
 struct ISABus {
 struct ISABus {
     /*< private >*/
     /*< private >*/
     BusState parent_obj;
     BusState parent_obj;

+ 1 - 1
include/hw/isa/superio.h

@@ -44,7 +44,7 @@ typedef struct ISASuperIOFuncs {
 
 
 struct ISASuperIOClass {
 struct ISASuperIOClass {
     /*< private >*/
     /*< private >*/
-    ISADeviceClass parent_class;
+    DeviceClass parent_class;
     /*< public >*/
     /*< public >*/
     DeviceRealize parent_realize;
     DeviceRealize parent_realize;
 
 

+ 1 - 1
include/hw/timer/i8254_internal.h

@@ -58,7 +58,7 @@ struct PITCommonState {
 };
 };
 
 
 struct PITCommonClass {
 struct PITCommonClass {
-    ISADeviceClass parent_class;
+    DeviceClass parent_class;
 
 
     void (*set_channel_gate)(PITCommonState *s, PITChannelState *sc, int val);
     void (*set_channel_gate)(PITCommonState *s, PITChannelState *sc, int val);
     void (*get_channel_info)(PITCommonState *s, PITChannelState *sc,
     void (*get_channel_info)(PITCommonState *s, PITChannelState *sc,