Gavin noticed the same pattern is duplicated in many CPUClass::class_by_name() handlers [*]. This series consolidate the calls to - object_class_is_abstract() - object_class_dynamic_cast() in the common cpu_class_by_name(), by introducing the CPUClass::cpu_resolving_type field.
[*] https://lore.kernel.org/qemu-devel/ab07d81c-da98-a270-c3f6-0625912c6...@redhat.com/ Philippe Mathieu-Daudé (4): target/alpha: Tidy up alpha_cpu_class_by_name() hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name() hw/cpu: Introduce CPUClass::cpu_resolving_type field hw/cpu: Call object_class_dynamic_cast() once in cpu_class_by_name() include/hw/core/cpu.h | 9 ++++++--- hw/core/cpu-common.c | 15 ++++++++++++--- target/alpha/cpu.c | 11 ++++------- target/arm/cpu.c | 6 ++---- target/avr/cpu.c | 6 ++---- target/cris/cpu.c | 6 ++---- target/hexagon/cpu.c | 6 ++---- target/hppa/cpu.c | 1 + target/i386/cpu.c | 1 + target/loongarch/cpu.c | 7 ++----- target/m68k/cpu.c | 6 ++---- target/microblaze/cpu.c | 1 + target/mips/cpu.c | 1 + target/nios2/cpu.c | 1 + target/openrisc/cpu.c | 6 ++---- target/ppc/cpu_init.c | 1 + target/riscv/cpu.c | 6 ++---- target/rx/cpu.c | 7 ++----- target/s390x/cpu.c | 1 + target/sh4/cpu.c | 4 +--- target/sparc/cpu.c | 1 + target/tricore/cpu.c | 6 ++---- target/xtensa/cpu.c | 6 ++---- 23 files changed, 53 insertions(+), 62 deletions(-) -- 2.41.0