summaryrefslogtreecommitdiffstats
path: root/target/alpha/cpu.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2017-09-18 01:28:42 +0200
committerEduardo Habkost2017-10-10 04:21:52 +0200
commit8301ea444abb49f7b7fb939b09c1e23b22977f30 (patch)
tree22dc7963464b3615aa96e96d6d873f1fb072c74d /target/alpha/cpu.c
parentMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff)
downloadqemu-8301ea444abb49f7b7fb939b09c1e23b22977f30.tar.gz
qemu-8301ea444abb49f7b7fb939b09c1e23b22977f30.tar.xz
qemu-8301ea444abb49f7b7fb939b09c1e23b22977f30.zip
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/alpha/cpu.c')
-rw-r--r--target/alpha/cpu.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index e6c6aabdf0..b8a21f4e01 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -127,14 +127,10 @@ static const AlphaCPUAlias alpha_cpu_aliases[] = {
static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
{
- ObjectClass *oc = NULL;
+ ObjectClass *oc;
char *typename;
int i;
- if (cpu_model == NULL) {
- return NULL;
- }
-
oc = object_class_by_name(cpu_model);
if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL &&
!object_class_is_abstract(oc)) {