From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCArO-0006c1-TX for qemu-devel@nongnu.org; Mon, 26 Mar 2012 10:25:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCArI-0007ge-I1 for qemu-devel@nongnu.org; Mon, 26 Mar 2012 10:25:26 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44724 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCArI-0007gL-8k for qemu-devel@nongnu.org; Mon, 26 Mar 2012 10:25:20 -0400 Message-ID: <4F707C4C.4030602@suse.de> Date: Mon, 26 Mar 2012 16:25:16 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1332727608-26523-1-git-send-email-liwp@linux.vnet.ibm.com> <1332727608-26523-4-git-send-email-liwp@linux.vnet.ibm.com> In-Reply-To: <1332727608-26523-4-git-send-email-liwp@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/6] convert pci-host to QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanpeng Li Cc: Gavin Shan , Anthony Liguori , qemu-devel@nongnu.org, Avi Kivity Am 26.03.2012 04:06, schrieb Wanpeng Li: > From: Anthony Liguori >=20 >=20 > Signed-off-by: Anthony Liguori > Signed-off-by: Wanpeng Li Some minor formal comments inline, otherwise looks okay. > --- > hw/pci_host.c | 26 ++++++++++++++++++++++++++ > hw/pci_host.h | 5 +++++ > 2 files changed, 31 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/pci_host.c b/hw/pci_host.c > index 44c6c20..44d7e55 100644 > --- a/hw/pci_host.c > +++ b/hw/pci_host.c > @@ -162,4 +162,30 @@ const MemoryRegionOps pci_host_data_be_ops =3D { > .endianness =3D DEVICE_BIG_ENDIAN, > }; > =20 > +void pci_host_set_mmio(PCIHostState *s, MemoryRegion *value) > +{ > + object_property_set_link(OBJECT(s), OBJECT(value), "mmio", NULL); > +} > + > +static void pci_host_initfn(Object *obj) > +{ > + PCIHostState *s =3D PCI_HOST(obj); > + > + object_property_add_link(obj, "mmio", TYPE_MEMORY_REGION, > + (Object **)&s->address_space, NULL); > +} > + > +static TypeInfo pci_host_type =3D { I thought the convention was ..._type_info (in case we ever need to do a mass conversion again). And please make it static const. > + .name =3D TYPE_PCI_HOST, > + .parent =3D TYPE_SYS_BUS_DEVICE, > + .instance_size =3D sizeof(PCIHostState), > + .instance_init =3D pci_host_initfn, > +}; > + > +static void register_devices(void) pci_host_register_types please. > +{ > + type_register_static(&pci_host_type); > +} > + > +type_init(register_devices); No semicolon please, it's not a statement. There's still some tabs left in the revised version, please run script/checkpatch.pl and repost a v3 inline so that we can comment on it. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg