From e81fa596bc448d3f91da675a1febf4ea0bd83f04 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Sep 2018 17:33:57 -0400 Subject: [PATCH] target/arm/cpu: Use type_register instead of type_register_static() in arm_cpu_register_types() The lifetime of the TypeInfo instance doesn't live indefinitely, so we should be using the regular type_register(). --- qemu/target/arm/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu/target/arm/cpu.c b/qemu/target/arm/cpu.c index 240008fc..5c16172e 100644 --- a/qemu/target/arm/cpu.c +++ b/qemu/target/arm/cpu.c @@ -1707,8 +1707,8 @@ static void cpu_register(struct uc_struct *uc, const ARMCPUInfo *info) void arm_cpu_register_types(void *opaque) { const ARMCPUInfo *info = arm_cpus; - - TypeInfo arm_cpu_type_info = { 0 }; + + TypeInfo arm_cpu_type_info = {0}; arm_cpu_type_info.name = TYPE_ARM_CPU, arm_cpu_type_info.parent = TYPE_CPU, arm_cpu_type_info.instance_userdata = opaque, @@ -1720,7 +1720,7 @@ void arm_cpu_register_types(void *opaque) arm_cpu_type_info.class_size = sizeof(ARMCPUClass), arm_cpu_type_info.class_init = arm_cpu_class_init, - type_register_static(opaque, &arm_cpu_type_info); + type_register(opaque, &arm_cpu_type_info); while (info->name) { cpu_register(opaque, info);