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

@ -246,10 +246,6 @@ static ObjectClass *lm32_cpu_class_by_name(const char *cpu_model)
ObjectClass *oc;
char *typename;
if (cpu_model == NULL) {
return NULL;
}
typename = g_strdup_printf("%s-" TYPE_LM32_CPU, cpu_model);
oc = object_class_by_name(typename);
g_free(typename);