From nobody Thu Apr 3 11:28:44 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1742917316; cv=none; d=zohomail.com; s=zohoarc; b=SjyNILbb4gZb6qWjb23RKqD24ihf0ttL2qUdsnqGQLzJyGlf+KsXRCMLtgjj3EAp4hqtpi+uS5zjvkpgao8jhC7pCz8n35Gx9gorCAX9Y6EfcMRUj5+O5CKeXYzpiNEBl4JnepqbTYNWskSvngV/xcpB0bgjjve1D6ccjDjR3kw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742917316; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=B9EcvePMMiziHxvQ+1Uv0hWd3cavq64til709QLPVTs=; b=m5GDcRKuFGmteL1A42izm6noM6/I4SnJv46y2XJhPQgH3ACP65F+w4xuWEZ4HuYfhdBqwIwPYcecohlCAjMjH85mBND+dKd8mV7M8feYiltuadLUy7DCSw4/n1uXmQSYujuzQjWBkEYuJyLsi7hx57wgGFimRgymN7mXtrv6Bnc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1742917316634103.91023237139007; Tue, 25 Mar 2025 08:41:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tx6P0-0003oe-PT; Tue, 25 Mar 2025 11:41:19 -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 1tx6Oy-0003o2-4x for qemu-devel@nongnu.org; Tue, 25 Mar 2025 11:41:16 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tx6Ou-00046l-FL for qemu-devel@nongnu.org; Tue, 25 Mar 2025 11:41:15 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43cfba466b2so53877155e9.3 for ; Tue, 25 Mar 2025 08:41:12 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9955c0sm13861946f8f.3.2025.03.25.08.41.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 25 Mar 2025 08:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742917270; x=1743522070; 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=B9EcvePMMiziHxvQ+1Uv0hWd3cavq64til709QLPVTs=; b=Gt4d5ZxdsOyWr5a01vlFwq9CFfwHxjTGoDXCLshNR2/whoLCc4pKLLOUs+zrDl1Aa2 AkbyLhd305lpxVoyeYazb9C0I2SNUnuh0zmIvii/kVNkbhGiRx/tCCcBWP6yPNfkJAuW 4zc/cmi9tXnMBRRIMxMQnusX0xo1NbyIaX+8B19GrPgU7kDIi7MqnLmBB+R4ToHaDmn9 6jrIHWlsyf0sr8OCWv/kXcxIzY9l3lx5NGacS8JD8LnmBFzGmqV3fKelOAwzw4ssaza1 267RMHMht7sgQIlKKBx3E8pxM1Zlo1xpCYXuGCXnb5Fp4eKfQcqFJIM6ozvrgHUqHFRx qEDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742917270; x=1743522070; 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=B9EcvePMMiziHxvQ+1Uv0hWd3cavq64til709QLPVTs=; b=ne+AKGyjAktMHpK+dPfOL9GtI9nrZ0RPW1TmmM3MYE71pvRzLqdbO+J88Blm/6x1wa LEdbkMTIlH1ffT71jbeHqNiRlpMa0aFxF4S9KDApAjSjpimmeU71ljSQBUTAJdT5XoEq vOOEd/s3nuy5ESIizYsdF9HGmYy8abDECobbzRcsvo/s2mSAG054Ne6w98XzBq4o1l4m 9ro9cbg2be95F9128Udk3MayVQTV5JPYOXlHZT8tSreUNSW0k79o1PxE+wsyQd2hqNI5 psYRX2MEcnju7r6keSv7el8U0Xsa2C90aIfEaugMaV4zzmJOS30tdlv3hAPxw8hrWD9R HnPA== X-Gm-Message-State: AOJu0YyUIccSL1zl0ZAnidbJVM4eKgTexz9tRghJDerjdb8dxn0cj5Fr TOCqQhI95+Qmlh1CGRropwXmd9HUIcvc74sMOOzs0XHBsl1CMiOTpjqmMXy5r5E66E4PXuIL5MK 8 X-Gm-Gg: ASbGncvUB/a+y/tnDyYah6msT52NCnGaLkMDDl7vqV3lXSxE3i3nY2CVXOoxxsCY5Um wOjasAhJ6WbJ3SCZjT8/5eN2yIrjkIoE1FXEgQdE58HKLEEo6R0Kp170CxkTN+2m57ZrZhseSWq ig9XYVH2lJoKxO0hoBZDPKOSAgj0Njk8DJFVaUU6lgb3c6CQluHGM/P+D8sbLj3PNGz4GqOA2Gu sDruj/514l/kZtfEtdoPJr5eTQpzdUrI0kfR/MEE1yZ/OCPaEoZdz5j2wlR9vbEPdW4R8i1dDIh tqyzuHQ0/y/DhS4AtunK15dbBOBsnhH0BfV7jUM84MQiyqXU9EY3v4uz2QuanzGTgWNEkvW2QKS VqV4JIDq1eO0cd+dXQ9g= X-Google-Smtp-Source: AGHT+IFVn8V1/KX8LHz5TKfTH3Bq1V1p3NnDxQEWWA7VWJ3gnAhAlsXB06IaaBMapFZmlBoN0CetNw== X-Received: by 2002:a05:6000:4188:b0:391:487f:27e7 with SMTP id ffacd0b85a97d-3997f947b9dmr11810016f8f.55.1742917270166; Tue, 25 Mar 2025 08:41:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Pierrick Bouvier , Zhao Liu , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Jiaxun Yang , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Anton Johansson , Richard Henderson Subject: [PATCH-for-10.1 2/8] target/mips: Declare CPU QOM types using DEFINE_TYPES() macro Date: Tue, 25 Mar 2025 16:40:52 +0100 Message-ID: <20250325154058.92735-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250325154058.92735-1-philmd@linaro.org> References: <20250325154058.92735-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1742917319015019100 When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. In few commits we are going to add more types, so replace the type_register_static() to ease further reviews. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- target/mips/cpu.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index b207106dd79..097554fd8ae 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -597,17 +597,21 @@ static void mips_cpu_class_init(ObjectClass *c, void = *data) #endif /* CONFIG_TCG */ } =20 -static const TypeInfo mips_cpu_type_info =3D { - .name =3D TYPE_MIPS_CPU, - .parent =3D TYPE_CPU, - .instance_size =3D sizeof(MIPSCPU), - .instance_align =3D __alignof(MIPSCPU), - .instance_init =3D mips_cpu_initfn, - .abstract =3D true, - .class_size =3D sizeof(MIPSCPUClass), - .class_init =3D mips_cpu_class_init, +static const TypeInfo mips_cpu_types[] =3D { + { + .name =3D TYPE_MIPS_CPU, + .parent =3D TYPE_CPU, + .instance_size =3D sizeof(MIPSCPU), + .instance_align =3D __alignof(MIPSCPU), + .instance_init =3D mips_cpu_initfn, + .abstract =3D true, + .class_size =3D sizeof(MIPSCPUClass), + .class_init =3D mips_cpu_class_init, + } }; =20 +DEFINE_TYPES(mips_cpu_types) + static void mips_cpu_cpudef_class_init(ObjectClass *oc, void *data) { MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(oc); @@ -632,7 +636,6 @@ static void mips_cpu_register_types(void) { int i; =20 - type_register_static(&mips_cpu_type_info); for (i =3D 0; i < mips_defs_number; i++) { mips_register_cpudef_type(&mips_defs[i]); } --=20 2.47.1