aboutsummaryrefslogtreecommitdiff
path: root/target/rx
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-09-08 10:09:23 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2023-11-07 13:08:48 +0100
commit3a9d0d7b64b72144369f48ef12ef0ed69d633fd6 (patch)
treeb128b396aa6f9304978df82dc3dee4a940997f86 /target/rx
parent55f2cd77376c6f2187ff386ab3b330ef260eedb2 (diff)
downloadqemu-3a9d0d7b64b72144369f48ef12ef0ed69d633fd6.zip
qemu-3a9d0d7b64b72144369f48ef12ef0ed69d633fd6.tar.gz
qemu-3a9d0d7b64b72144369f48ef12ef0ed69d633fd6.tar.bz2
hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name()
Let CPUClass::class_by_name() handlers to return abstract classes, and filter them once in the public cpu_class_by_name() method. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230908112235.75914-3-philmd@linaro.org>
Diffstat (limited to 'target/rx')
-rw-r--r--target/rx/cpu.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/target/rx/cpu.c b/target/rx/cpu.c
index 4d0d3a0..9cc9d9d 100644
--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -111,16 +111,12 @@ static ObjectClass *rx_cpu_class_by_name(const char *cpu_model)
char *typename;
oc = object_class_by_name(cpu_model);
- if (oc != NULL && object_class_dynamic_cast(oc, TYPE_RX_CPU) != NULL &&
- !object_class_is_abstract(oc)) {
+ if (oc != NULL && object_class_dynamic_cast(oc, TYPE_RX_CPU) != NULL) {
return oc;
}
typename = g_strdup_printf(RX_CPU_TYPE_NAME("%s"), cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
- if (oc != NULL && object_class_is_abstract(oc)) {
- oc = NULL;
- }
return oc;
}