diff options
author | Igor Mammedov | 2018-02-07 15:30:57 +0100 |
---|---|---|
committer | Eduardo Habkost | 2018-03-19 18:10:36 +0100 |
commit | 99193d8f2ef594648ad67cc3d007b0e4fb2f8cf8 (patch) | |
tree | 41c586d95ca50ce632e5db98531f596559ef4438 /target | |
parent | cpu: get rid of unused cpu_init() defines (diff) | |
download | qemu-99193d8f2ef594648ad67cc3d007b0e4fb2f8cf8.tar.gz qemu-99193d8f2ef594648ad67cc3d007b0e4fb2f8cf8.tar.xz qemu-99193d8f2ef594648ad67cc3d007b0e4fb2f8cf8.zip |
cpu: drop unnecessary NULL check and cpu_common_class_by_name()
both do nothing as for the first all callers
parse_cpu_model() and qmp_query_cpu_model_()
should provide non NULL value, so just abort if it's not so.
While at it drop cpu_common_class_by_name() which is not need
any more as every target has CPUClass::class_by_name callback
by now, though abort in case a new arch will forget to define one.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1518013857-4372-1-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/i386/cpu.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6bb4ce8719..30b4af897b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -781,13 +781,7 @@ static char *x86_cpu_type_name(const char *model_name) static ObjectClass *x86_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; - char *typename; - - if (cpu_model == NULL) { - return NULL; - } - - typename = x86_cpu_type_name(cpu_model); + char *typename = x86_cpu_type_name(cpu_model); oc = object_class_by_name(typename); g_free(typename); return oc; |