From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01152CDB465 for ; Sat, 14 Oct 2023 15:15:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrgM9-0001MN-Db; Sat, 14 Oct 2023 11:15:09 -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 1qrgM7-0001La-S3 for qemu-devel@nongnu.org; Sat, 14 Oct 2023 11:15:07 -0400 Received: from hsmtpd-def.xspmail.jp ([2001:240:bb81:94:202:238:198:237]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrgM5-0002GA-Gz for qemu-devel@nongnu.org; Sat, 14 Oct 2023 11:15:07 -0400 X-Country-Code: JP Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) by hsmtpd-out-2.asahinet.cluster.xspmail.jp (Halon) with ESMTPA id a6a30ada-5775-491e-a0f4-8a32de38e0a3; Sun, 15 Oct 2023 00:08:57 +0900 (JST) Received: from SIOS1075.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id CFCFA1C0037; Sun, 15 Oct 2023 00:08:56 +0900 (JST) Date: Sun, 15 Oct 2023 00:08:53 +0900 Message-ID: <87bkd18cmy.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Philippe =?ISO-8859-1?Q?Mathieu-Daud=E9?= Cc: qemu-devel@nongnu.org, Magnus Damm , qemu-trivial@nongnu.org Subject: Re: [PATCH 1/3] hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro In-Reply-To: <20231012041237.22281-2-philmd@linaro.org> References: <20231012041237.22281-1-philmd@linaro.org> <20231012041237.22281-2-philmd@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Received-SPF: softfail client-ip=2001:240:bb81:94:202:238:198:237; envelope-from=ysato@users.sourceforge.jp; helo=hsmtpd-def.xspmail.jp X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.665 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Thu, 12 Oct 2023 13:12:35 +0900, Philippe Mathieu-Daud=E9 wrote: >=20 > 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. >=20 > Signed-off-by: Philippe Mathieu-Daud=E9 Reviewed-by: Yoshinori Sato > --- > hw/pci-host/sh_pci.c | 40 +++++++++++++++++----------------------- > 1 file changed, 17 insertions(+), 23 deletions(-) >=20 > diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c > index 77e7bbc65f..41aed48c85 100644 > --- a/hw/pci-host/sh_pci.c > +++ b/hw/pci-host/sh_pci.c > @@ -167,17 +167,6 @@ static void sh_pci_host_class_init(ObjectClass *klas= s, void *data) > dc->user_creatable =3D false; > } > =20 > -static const TypeInfo sh_pci_host_info =3D { > - .name =3D "sh_pci_host", > - .parent =3D TYPE_PCI_DEVICE, > - .instance_size =3D sizeof(PCIDevice), > - .class_init =3D sh_pci_host_class_init, > - .interfaces =3D (InterfaceInfo[]) { > - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, > - { }, > - }, > -}; > - > static void sh_pci_device_class_init(ObjectClass *klass, void *data) > { > DeviceClass *dc =3D DEVICE_CLASS(klass); > @@ -185,17 +174,22 @@ static void sh_pci_device_class_init(ObjectClass *k= lass, void *data) > dc->realize =3D sh_pci_device_realize; > } > =20 > -static const TypeInfo sh_pci_device_info =3D { > - .name =3D TYPE_SH_PCI_HOST_BRIDGE, > - .parent =3D TYPE_PCI_HOST_BRIDGE, > - .instance_size =3D sizeof(SHPCIState), > - .class_init =3D sh_pci_device_class_init, > +static const TypeInfo sh_pcic_types[] =3D { > + { > + .name =3D TYPE_SH_PCI_HOST_BRIDGE, > + .parent =3D TYPE_PCI_HOST_BRIDGE, > + .instance_size =3D sizeof(SHPCIState), > + .class_init =3D sh_pci_device_class_init, > + }, { > + .name =3D "sh_pci_host", > + .parent =3D TYPE_PCI_DEVICE, > + .instance_size =3D sizeof(PCIDevice), > + .class_init =3D sh_pci_host_class_init, > + .interfaces =3D (InterfaceInfo[]) { > + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, > + { }, > + }, > + }, > }; > =20 > -static void sh_pci_register_types(void) > -{ > - type_register_static(&sh_pci_device_info); > - type_register_static(&sh_pci_host_info); > -} > - > -type_init(sh_pci_register_types) > +DEFINE_TYPES(sh_pcic_types) > --=20 > 2.41.0 >=20