qom/cpu: move cpu_model null check to cpu_class_by_name()

and clean every implementation.

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170917232842.14544-1-f4bug@amsat.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2017-09-17 20:28:42 -03:00 committed by Eduardo Habkost
parent 530049bc1d
commit 8301ea444a
14 changed files with 8 additions and 56 deletions

View file

@ -939,10 +939,6 @@ static ObjectClass *arm_cpu_class_by_name(const char *cpu_model)
char *typename;
char **cpuname;
if (!cpu_model) {
return NULL;
}
cpuname = g_strsplit(cpu_model, ",", 1);
typename = g_strdup_printf(ARM_CPU_TYPE_NAME("%s"), cpuname[0]);
oc = object_class_by_name(typename);