[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functi
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functions |
Date: |
Fri, 13 Jun 2014 16:44:09 -0300 |
When all a compat function does is to call the previous compat function,
we don't need to set compat_func, as the previous class_init function
already set it.
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/i386/pc_piix.c | 21 +--------------------
hw/i386/pc_q35.c | 21 +--------------------
2 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index aef23b1..3549edb 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -261,29 +261,14 @@ static void pc_init1(MachineState *machine)
}
}
-static void pc_compat_2_0(MachineState *machine)
-{
-}
-
static void pc_compat_1_7(MachineState *machine)
{
- pc_compat_2_0(machine);
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
}
-static void pc_compat_1_6(MachineState *machine)
-{
- pc_compat_1_7(machine);
-}
-
-static void pc_compat_1_5(MachineState *machine)
-{
- pc_compat_1_6(machine);
-}
-
static void pc_compat_1_4(MachineState *machine)
{
- pc_compat_1_5(machine);
+ pc_compat_1_7(machine);
x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0,
CPUID_EXT_PCLMULQDQ);
}
@@ -393,7 +378,6 @@ static void pc_i440fx_machine_v2_0_class_init(ObjectClass
*oc, void *data)
machine_class_add_compat_props(mc, compat_props);
pcmc->smbios_legacy_mode = true;
pcmc->has_reserved_memory = false;
- pcmc->compat_func = pc_compat_2_0;
}
static TypeInfo pc_i440fx_machine_v2_0_type_info = {
@@ -439,7 +423,6 @@ static void pc_i440fx_machine_v1_6_class_init(ObjectClass
*oc, void *data)
mc->rom_file_has_mr = false;
machine_class_add_compat_props(mc, compat_props);
pcmc->has_acpi_build = false;
- pcmc->compat_func = pc_compat_1_6;
}
static TypeInfo pc_i440fx_machine_v1_6_type_info = {
@@ -451,7 +434,6 @@ static TypeInfo pc_i440fx_machine_v1_6_type_info = {
static void pc_i440fx_machine_v1_5_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
- PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
static GlobalProperty compat_props[] = {
PC_COMPAT_1_5,
{ /* end of list */ }
@@ -459,7 +441,6 @@ static void pc_i440fx_machine_v1_5_class_init(ObjectClass
*oc, void *data)
pc_i440fx_machine_v1_6_class_init(oc, data);
mc->name = "pc-i440fx-1.5";
machine_class_add_compat_props(mc, compat_props);
- pcmc->compat_func = pc_compat_1_5;
}
static TypeInfo pc_i440fx_machine_v1_5_type_info = {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index aa27314..9e30130 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -244,29 +244,14 @@ static void pc_q35_init(MachineState *machine)
}
}
-static void pc_compat_2_0(MachineState *machine)
-{
-}
-
static void pc_compat_1_7(MachineState *machine)
{
- pc_compat_2_0(machine);
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
}
-static void pc_compat_1_6(MachineState *machine)
-{
- pc_compat_1_7(machine);
-}
-
-static void pc_compat_1_5(MachineState *machine)
-{
- pc_compat_1_6(machine);
-}
-
static void pc_compat_1_4(MachineState *machine)
{
- pc_compat_1_5(machine);
+ pc_compat_1_7(machine);
x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0,
CPUID_EXT_PCLMULQDQ);
}
@@ -319,7 +304,6 @@ static void pc_q35_machine_v2_0_class_init(ObjectClass *oc,
void *data)
mc->name = "pc-q35-2.0";
pcmc->smbios_legacy_mode = true;
pcmc->has_reserved_memory = false;
- pcmc->compat_func = pc_compat_2_0;
}
static TypeInfo pc_q35_machine_v2_0_type_info = {
@@ -364,7 +348,6 @@ static void pc_q35_machine_v1_6_class_init(ObjectClass *oc,
void *data)
mc->rom_file_has_mr = false;
machine_class_add_compat_props(mc, compat_props);
mc->name = "pc-q35-1.6";
- pcmc->compat_func = pc_compat_1_6;
pcmc->has_acpi_build = false;
}
@@ -377,7 +360,6 @@ static TypeInfo pc_q35_machine_v1_6_type_info = {
static void pc_q35_machine_v1_5_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
- PCMachineClass *pcmc = PC_MACHINE_CLASS(oc);
static GlobalProperty compat_props[] = {
PC_Q35_COMPAT_1_5,
{ /* end of list */ }
@@ -385,7 +367,6 @@ static void pc_q35_machine_v1_5_class_init(ObjectClass *oc,
void *data)
pc_q35_machine_v1_6_class_init(oc, data);
machine_class_add_compat_props(mc, compat_props);
mc->name = "pc-q35-1.5";
- pcmc->compat_func = pc_compat_1_5;
}
static TypeInfo pc_q35_machine_v1_5_type_info = {
--
1.9.0
- [Qemu-devel] [RFC v2 21/39] pc: Move smbios_defaults to PCMachineClass, (continued)
- [Qemu-devel] [RFC v2 21/39] pc: Move smbios_defaults to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 22/39] pc: Move has_acpi_build to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 23/39] pc: Move has_pci_info to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 24/39] pc: Move gigabyte_align to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 04/39] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 25/39] pc: Move has_reserved_memory to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 26/39] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 27/39] piix: Eliminate pc_init_pci(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 28/39] piix: Introduce struct PCI440FXMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 29/39] pc: Create common machine init function, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functions,
Eduardo Habkost <=
- [Qemu-devel] [RFC v2 31/39] piix: Move compat/init functions closer to corresponding class_init, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 32/39] pc: Rename pc_machine variable to pcms, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 34/39] pc: Move duplicate Xen init code to pc_machine_init(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 35/39] pc: Move icc_bridge variable to PCMachineState, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 36/39] pc: Move duplicate icc-bridge and CPU initalization to pc_machine_init(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 37/39] pc: Make pc_cpus_init() static, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 38/39] pc: Make pc_cpus_init() use PCMachineState, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 39/39] machine: Eliminate QEMUMachine.compat_props, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 19/39] pc: Move kvmclock_enabled to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 20/39] pc: Move smbios_legacy_mode to PCMachineClass, Eduardo Habkost, 2014/06/13