From patchwork Fri Sep 8 11:22:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 720799 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp705405wrp; Fri, 8 Sep 2023 04:24:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFI/f9mymZe/RrJj/OIpdADeApgt9h832PM0H0ciSA0o6Vr7ek1P2Z+WTX7Tdf1Z7QK+WD/ X-Received: by 2002:a05:6214:a08:b0:647:18a7:2e28 with SMTP id dw8-20020a0562140a0800b0064718a72e28mr1703610qvb.61.1694172247058; Fri, 08 Sep 2023 04:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694172247; cv=none; d=google.com; s=arc-20160816; b=RBtdcm6ztrc2bmd/JE2bKs386+Czzq3Ew6zDHqCwQTP/L/oR+bIzkKtWZ0f9J89d5W c2TXogUEQOIdraBR+uslBENpQ3QOI/7UjY+Ythe/H5W4GFRdwhm9+xWQSYCZwIC44WtA JselUEuK9JEFTiu+l67G3lbMNNA5dS6RBOW/+PizQW9g5IpmSiYAAa1uvMk0URUDE6NR d8lIc1DLj5bnXISX+RjDN1OxBccrdHAhhBZWOIdeOB91tmdmlHBd/FdIKWIwYt9pi3MT zTkxTvZgoOgbdKGo+vB7jrIt3EGl9wPcCuP0XFw8XKkluBSDHCgjRtZ+CCDZS7UXAV2V uywA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fZx/41xnQx3UrrNBNxaWrVM+nipc/J4j8tticD5Myes=; fh=xrkPdSTzLfgAPR/xILKWCY/2YOP2wIq4k78J4mWio7M=; b=hLX8c8Oxbz0S7OHY7B8VG7HIdVEaA0tupXXiPsppDbjPUxNB7SnaO1IPs8yN+MpvCt QKFGPogNUpQXH6cR8dosfXgEKWL/EFAD3wsmh2sxyGHRxVT5M9OTN/VgBdweooBclERD NzI0yDKgPvOFyAMsvCm5ixsGrqiLJLJtYzKK236T7KAKpYHEEn60uB1q3OZu2QRSPw1J bIpZ243LA8pLO0Orp5SyuAyX/Z9+FKsU73hwGQA9g4AUNhXZSaZSdvtAecJyqoSe96hg z28g2Neu5Nv3U8+zULuWsZju6Dpj0teW74s8Lx8RcdIB2tXn9wNy4h/1FSi60mIHi7Mq ApFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j2cZ0o22; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a12-20020a0ce34c000000b0063d6cf5bab0si991683qvm.197.2023.09.08.04.24.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Sep 2023 04:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j2cZ0o22; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeZZi-0003gY-NH; Fri, 08 Sep 2023 07:22:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeZZf-0003fN-Ou for qemu-devel@nongnu.org; Fri, 08 Sep 2023 07:22:55 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeZZb-0003WW-87 for qemu-devel@nongnu.org; Fri, 08 Sep 2023 07:22:55 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3ff7d73a6feso20013995e9.1 for ; Fri, 08 Sep 2023 04:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694172169; x=1694776969; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fZx/41xnQx3UrrNBNxaWrVM+nipc/J4j8tticD5Myes=; b=j2cZ0o22rQdp4mPZo2LjJqtbtZVlcYmWgIJxGRTPRo8OS/IgQsSobtlhcRAYwzau8J j/PkjNogPTqkUmAmE8XNaoKKcs3HomhydI5Q9lraRBS99WXOFqhfPPfG8QKvKNrNsq1I jJT0DyN9iJFVJAE5ZFJdZ655DLFrF2aei8TW/lf+WK7uH/hIanPJlDcA7NFjzvoge8CP oET1C+MtCTARWdH42/zX4Yc/4OtlM+aTLdHPHcx/c9WseU7q47LdAUz86HEnoF1nZdeH ZQD53OlTlQXR2JeFG9dyt9HizzycDM9DLkiPCVsWD8viF9mFOum9Vdx0t4X1iX+0gEBN CLzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694172169; x=1694776969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fZx/41xnQx3UrrNBNxaWrVM+nipc/J4j8tticD5Myes=; b=CxAyatLhELFp3NPoDtPUpO3s8SjgwCi7/G5m3VNYnQGHtqXRrRjFR94fkQGGNuZQYg EksPjIjps0tOXgXFk/vpX6OvhWBAt5lVhlwnwowk7AjFSZ50LzrbyO8wUzJCL0tGtrHq EwLd5HBbOkQKlO7HOD/G99i4qzSg8ip49j2HSrBDDHqKkyEVBdRmevE+W1u02NJk+TKy 4bbck5OjRCoWvaSqw8u+66cyiPm0DnyRktt6vt5Qwz+F1II/kicDps11EKduMnYuU2GP p5YuFtu2UW2YKY+2RVRHOEuHlW3SgRDnUCmtRAX9JN/598u4ptA4l3Vej5ZD7diDWzpL qJvQ== X-Gm-Message-State: AOJu0YwEjIxvRqxeqRo8lejQ2jpjMF1wPMDYBucXvBrEk88B/iEtodtu Knd3bdiv/xQjQFu5i+/pMS4xZWVhnetmKGzHfr4= X-Received: by 2002:a1c:741a:0:b0:401:b53e:6c57 with SMTP id p26-20020a1c741a000000b00401b53e6c57mr2164003wmc.9.1694172169282; Fri, 08 Sep 2023 04:22:49 -0700 (PDT) Received: from m1x-phil.lan (lfb24-h01-176-173-167-175.dsl.sta.abo.bbox.fr. [176.173.167.175]) by smtp.gmail.com with ESMTPSA id k9-20020a05600c0b4900b003fe2b081661sm4968607wmr.30.2023.09.08.04.22.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 08 Sep 2023 04:22:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, David Hildenbrand , Gavin Shan Cc: Chris Wulff , David Gibson , qemu-s390x@nongnu.org, Weiwei Li , qemu-arm@nongnu.org, Mark Cave-Ayland , Jiaxun Yang , Yoshinori Sato , Richard Henderson , Marcel Apfelbaum , Max Filippov , Nicholas Piggin , Eduardo Habkost , Ilya Leoshkevich , Bastian Koppelmann , Greg Kurz , "Edgar E. Iglesias" , qemu-ppc@nongnu.org, Daniel Henrique Barboza , Marek Vasut , Palmer Dabbelt , Michael Rolnik , Laurent Vivier , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , qemu-riscv@nongnu.org, Aurelien Jarno , Bin Meng , Xiaojuan Yang , Daniel Henrique Barboza , Aleksandar Rikalo , Artyom Tarasenko , Song Gao , Stafford Horne , Yanan Wang , Alistair Francis , Brian Cain , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Thomas Huth , Liu Zhiwei Subject: [PATCH 1/4] target/alpha: Tidy up alpha_cpu_class_by_name() Date: Fri, 8 Sep 2023 13:22:31 +0200 Message-ID: <20230908112235.75914-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230908112235.75914-1-philmd@linaro.org> References: <20230908112235.75914-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan --- 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")); }