Am 26.03.2012 04:06, schrieb Wanpeng Li: > From: Anthony Liguori <aligu...@us.ibm.com> > > > Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> > Signed-off-by: Wanpeng Li <l...@linux.vnet.ibm.com>
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(-) > > 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 = { > .endianness = DEVICE_BIG_ENDIAN, > }; > > +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 = PCI_HOST(obj); > + > + object_property_add_link(obj, "mmio", TYPE_MEMORY_REGION, > + (Object **)&s->address_space, > NULL); > +} > + > +static TypeInfo pci_host_type = { 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 = TYPE_PCI_HOST, > + .parent = TYPE_SYS_BUS_DEVICE, > + .instance_size = sizeof(PCIHostState), > + .instance_init = 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 -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg