[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] target/alpha: Tidy up alpha_cpu_class_by_name()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 1/4] target/alpha: Tidy up alpha_cpu_class_by_name() |
Date: |
Fri, 8 Sep 2023 13:22:31 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/alpha/cpu.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 270ae787b1..351ee2e9f2 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -142,13 +142,10 @@ static ObjectClass *alpha_cpu_class_by_name(const char
*cpu_model)
typename = g_strdup_printf(ALPHA_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;
- }
/* TODO: remove match everything nonsense */
- /* Default to ev67; no reason not to emulate insns by default. */
- if (!oc) {
+ if (!oc || object_class_is_abstract(oc)) {
+ /* Default to ev67; no reason not to emulate insns by default. */
oc = object_class_by_name(ALPHA_CPU_TYPE_NAME("ev67"));
}
--
2.41.0