CPUClass::class_by_name is called after the CPU model name and options were already split, there's no need to split the string again.
Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- Cc: Palmer Dabbelt <pal...@sifive.com> Cc: Alistair Francis <alistair.fran...@wdc.com> Cc: Sagar Karandikar <sag...@eecs.berkeley.edu> Cc: Bastian Koppelmann <kbast...@mail.uni-paderborn.de> Cc: qemu-ri...@nongnu.org --- target/riscv/cpu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index d61bce6d55..5e97a83c80 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -179,12 +179,9 @@ static ObjectClass *riscv_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; char *typename; - char **cpuname; - cpuname = g_strsplit(cpu_model, ",", 1); - typename = g_strdup_printf(RISCV_CPU_TYPE_NAME("%s"), cpuname[0]); + typename = g_strdup_printf(RISCV_CPU_TYPE_NAME("%s"), cpu_model); oc = object_class_by_name(typename); - g_strfreev(cpuname); g_free(typename); if (!oc || !object_class_dynamic_cast(oc, TYPE_RISCV_CPU) || object_class_is_abstract(oc)) { -- 2.18.0.rc1.1.g3f1ff2140