From d5ebe625569365e83c104f7ef4bbeab282299407 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Thu, 5 Oct 2017 15:50:56 +0200 Subject: sh4: simplify superh_cpu_class_by_name() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit currently for sh4 cpu_model argument for '-cpu' option could be either 'cpu model' name or cpu_typename. however typically '-cpu' takes 'cpu model' name and cpu type for sh4 target isn't advertised publicly ('-cpu help' prints only 'cpu model' names) so we shouldn't care about this use case (it's more of a bug). 1. Drop '-cpu cpu_typename' to align with the rest of targets. 2. Compose searched for typename from cpu model and use it with object_class_by_name() directly instead of over-complicated object_class_get_list() g_slist_find_custom() + superh_cpu_name_compare() With #1 droped, #2 could be used for both lookups which simplifies superh_cpu_class_by_name() quite a bit. Signed-off-by: Igor Mammedov Acked-by: Philippe Mathieu-Daudé Message-Id: <1507211474-188400-23-git-send-email-imammedo@redhat.com> [ehabkost: Include fixup sent by Igor] Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-user') diff --git a/linux-user/main.c b/linux-user/main.c index 28353f1..aa02f25 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4331,7 +4331,7 @@ int main(int argc, char **argv, char **envp) cpu_model = "750"; # endif #elif defined TARGET_SH4 - cpu_model = TYPE_SH7785_CPU; + cpu_model = "sh7785"; #elif defined TARGET_S390X cpu_model = "qemu"; #else -- cgit v1.1