mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 09:05:27 +00:00
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. Backports commit 99193d8f2ef594648ad67cc3d007b0e4fb2f8cf8 from qemu
This commit is contained in:
parent
cd27da0d88
commit
415b11ee49
|
@ -176,13 +176,9 @@ static bool cpu_common_debug_check_watchpoint(CPUState *cpu, CPUWatchpoint *wp)
|
|||
|
||||
ObjectClass *cpu_class_by_name(struct uc_struct *uc, const char *typename, const char *cpu_model)
|
||||
{
|
||||
CPUClass *cc;
|
||||
|
||||
if (!cpu_model) {
|
||||
return NULL;
|
||||
}
|
||||
cc = CPU_CLASS(uc, object_class_by_name(uc, typename));
|
||||
CPUClass *cc = CPU_CLASS(uc, object_class_by_name(uc, typename));
|
||||
|
||||
assert(cpu_model && cc->class_by_name);
|
||||
return cc->class_by_name(uc, cpu_model);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue