hw/core/machine: Constify MachineClass::valid_cpu_types[]
Constify MachineClass::valid_cpu_types[i], as suggested by Richard Henderson. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20231117071704.35040-2-philmd@linaro.org [PMD: Constify HPPA machines, restrict valid_cpu_types to machine_class_init() handlers] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
3efd849573
commit
790a4428f2
@ -672,19 +672,18 @@ static void hppa_nmi(NMIState *n, int cpu_index, Error **errp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *HP_B160L_machine_valid_cpu_types[] = {
|
|
||||||
TYPE_HPPA_CPU,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static void HP_B160L_machine_init_class_init(ObjectClass *oc, void *data)
|
static void HP_B160L_machine_init_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
|
static const char * const valid_cpu_types[] = {
|
||||||
|
TYPE_HPPA_CPU,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
MachineClass *mc = MACHINE_CLASS(oc);
|
MachineClass *mc = MACHINE_CLASS(oc);
|
||||||
NMIClass *nc = NMI_CLASS(oc);
|
NMIClass *nc = NMI_CLASS(oc);
|
||||||
|
|
||||||
mc->desc = "HP B160L workstation";
|
mc->desc = "HP B160L workstation";
|
||||||
mc->default_cpu_type = TYPE_HPPA_CPU;
|
mc->default_cpu_type = TYPE_HPPA_CPU;
|
||||||
mc->valid_cpu_types = HP_B160L_machine_valid_cpu_types;
|
mc->valid_cpu_types = valid_cpu_types;
|
||||||
mc->init = machine_HP_B160L_init;
|
mc->init = machine_HP_B160L_init;
|
||||||
mc->reset = hppa_machine_reset;
|
mc->reset = hppa_machine_reset;
|
||||||
mc->block_default_type = IF_SCSI;
|
mc->block_default_type = IF_SCSI;
|
||||||
@ -709,19 +708,18 @@ static const TypeInfo HP_B160L_machine_init_typeinfo = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *HP_C3700_machine_valid_cpu_types[] = {
|
|
||||||
TYPE_HPPA64_CPU,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data)
|
static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
|
static const char * const valid_cpu_types[] = {
|
||||||
|
TYPE_HPPA64_CPU,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
MachineClass *mc = MACHINE_CLASS(oc);
|
MachineClass *mc = MACHINE_CLASS(oc);
|
||||||
NMIClass *nc = NMI_CLASS(oc);
|
NMIClass *nc = NMI_CLASS(oc);
|
||||||
|
|
||||||
mc->desc = "HP C3700 workstation";
|
mc->desc = "HP C3700 workstation";
|
||||||
mc->default_cpu_type = TYPE_HPPA64_CPU;
|
mc->default_cpu_type = TYPE_HPPA64_CPU;
|
||||||
mc->valid_cpu_types = HP_C3700_machine_valid_cpu_types;
|
mc->valid_cpu_types = valid_cpu_types;
|
||||||
mc->init = machine_HP_C3700_init;
|
mc->init = machine_HP_C3700_init;
|
||||||
mc->reset = hppa_machine_reset;
|
mc->reset = hppa_machine_reset;
|
||||||
mc->block_default_type = IF_SCSI;
|
mc->block_default_type = IF_SCSI;
|
||||||
|
@ -726,19 +726,18 @@ static GlobalProperty hw_compat_q800[] = {
|
|||||||
};
|
};
|
||||||
static const size_t hw_compat_q800_len = G_N_ELEMENTS(hw_compat_q800);
|
static const size_t hw_compat_q800_len = G_N_ELEMENTS(hw_compat_q800);
|
||||||
|
|
||||||
static const char *q800_machine_valid_cpu_types[] = {
|
|
||||||
M68K_CPU_TYPE_NAME("m68040"),
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static void q800_machine_class_init(ObjectClass *oc, void *data)
|
static void q800_machine_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
|
static const char * const valid_cpu_types[] = {
|
||||||
|
M68K_CPU_TYPE_NAME("m68040"),
|
||||||
|
NULL
|
||||||
|
};
|
||||||
MachineClass *mc = MACHINE_CLASS(oc);
|
MachineClass *mc = MACHINE_CLASS(oc);
|
||||||
|
|
||||||
mc->desc = "Macintosh Quadra 800";
|
mc->desc = "Macintosh Quadra 800";
|
||||||
mc->init = q800_machine_init;
|
mc->init = q800_machine_init;
|
||||||
mc->default_cpu_type = M68K_CPU_TYPE_NAME("m68040");
|
mc->default_cpu_type = M68K_CPU_TYPE_NAME("m68040");
|
||||||
mc->valid_cpu_types = q800_machine_valid_cpu_types;
|
mc->valid_cpu_types = valid_cpu_types;
|
||||||
mc->max_cpus = 1;
|
mc->max_cpus = 1;
|
||||||
mc->block_default_type = IF_SCSI;
|
mc->block_default_type = IF_SCSI;
|
||||||
mc->default_ram_id = "m68k_mac.ram";
|
mc->default_ram_id = "m68k_mac.ram";
|
||||||
|
@ -273,7 +273,7 @@ struct MachineClass {
|
|||||||
bool has_hotpluggable_cpus;
|
bool has_hotpluggable_cpus;
|
||||||
bool ignore_memory_transaction_failures;
|
bool ignore_memory_transaction_failures;
|
||||||
int numa_mem_align_shift;
|
int numa_mem_align_shift;
|
||||||
const char **valid_cpu_types;
|
const char * const *valid_cpu_types;
|
||||||
strList *allowed_dynamic_sysbus_devices;
|
strList *allowed_dynamic_sysbus_devices;
|
||||||
bool auto_enable_numa_with_memhp;
|
bool auto_enable_numa_with_memhp;
|
||||||
bool auto_enable_numa_with_memdev;
|
bool auto_enable_numa_with_memdev;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user