From 8301ea444abb49f7b7fb939b09c1e23b22977f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sun, 17 Sep 2017 20:28:42 -0300 Subject: qom/cpu: move cpu_model null check to cpu_class_by_name() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and clean every implementation. Suggested-by: Eduardo Habkost Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20170917232842.14544-1-f4bug@amsat.org> Reviewed-by: Igor Mammedov Reviewed-by: Laurent Vivier Reviewed-by: Artyom Tarasenko Signed-off-by: Eduardo Habkost --- target/moxie/cpu.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'target/moxie') diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 748d02f..30bd44f 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; -- cgit v1.1