qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/6] convert pci-host to QOM


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 3/6] convert pci-host to QOM
Date: Mon, 26 Mar 2012 16:25:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120215 Thunderbird/10.0.2

Am 26.03.2012 04:06, schrieb Wanpeng Li:
> From: Anthony Liguori <address@hidden>
> 
> 
> Signed-off-by: Anthony Liguori <address@hidden>
> Signed-off-by: Wanpeng Li <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]