diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2017-09-17 20:28:42 -0300 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-10-09 23:21:52 -0300 |
commit | 8301ea444abb49f7b7fb939b09c1e23b22977f30 (patch) | |
tree | 22dc7963464b3615aa96e96d6d873f1fb072c74d /target/moxie | |
parent | 530049bc1dcc24c1178a29d99ca08b6dd08413e0 (diff) |
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>
Diffstat (limited to 'target/moxie')
-rw-r--r-- | target/moxie/cpu.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 748d02f29e..30bd44fcad 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -89,13 +89,7 @@ static void moxie_cpu_initfn(Object *obj) static ObjectClass *moxie_cpu_class_by_name(const char *cpu_model) { - ObjectClass *oc; - - if (cpu_model == NULL) { - return NULL; - } - - oc = object_class_by_name(cpu_model); + ObjectClass *oc = object_class_by_name(cpu_model); if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_MOXIE_CPU) || object_class_is_abstract(oc))) { return NULL; |