qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Wanpeng Li <liwp@linux.vnet.ibm.com>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/6] convert pci-host to QOM
Date: Mon, 26 Mar 2012 16:25:16 +0200	[thread overview]
Message-ID: <4F707C4C.4030602@suse.de> (raw)
In-Reply-To: <1332727608-26523-4-git-send-email-liwp@linux.vnet.ibm.com>

Am 26.03.2012 04:06, schrieb Wanpeng Li:
> From: Anthony Liguori <aliguori@us.ibm.com>
> 
> 
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Wanpeng Li <liwp@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

  parent reply	other threads:[~2012-03-26 14:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26  2:06 [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 1/6] eliminate piix_pci.c and module i440fx and piix3 Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 2/6] convert MemoryRegion to QOM Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 3/6] convert pci-host " Wanpeng Li
2012-03-26  7:32   ` Stefan Hajnoczi
2012-03-26  9:22   ` Wanpeng Li
2012-03-26 14:25   ` Andreas Färber [this message]
2012-03-26  2:06 ` [Qemu-devel] [PATCH 4/6] prepare to create HPET, RTC and i8254 through composition Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 5/6] merge pc_piix.c to pc.c Wanpeng Li
2012-03-26 12:42   ` Avi Kivity
2012-03-26 12:47     ` Jan Kiszka
2012-03-26 17:37       ` Anthony Liguori
2012-03-26  2:06 ` [Qemu-devel] [PATCH 6/6] make some functions static Wanpeng Li
2012-03-26 12:20 ` [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM Jan Kiszka
2012-03-26 15:54   ` Isaku Yamahata
2012-03-26 17:29     ` Anthony Liguori
2012-03-27 10:31       ` Avi Kivity
2012-03-27 13:52         ` Anthony Liguori
2012-03-27 14:18           ` Avi Kivity
2012-03-26 17:17   ` Blue Swirl
2012-03-26 17:33   ` Anthony Liguori
2012-03-26 19:30     ` Jan Kiszka
2012-03-26 19:35       ` Anthony Liguori
2012-03-26 19:37         ` Jan Kiszka
2012-03-26 19:39           ` Anthony Liguori
2012-03-26 19:44             ` Jan Kiszka
2012-03-26 19:49               ` Anthony Liguori
2012-03-26 20:10                 ` Jan Kiszka
2012-03-26 20:13                   ` Anthony Liguori
2012-03-26 20:30                     ` Jan Kiszka
2012-03-26 21:00                       ` Anthony Liguori
2012-03-26 19:52               ` Anthony Liguori
2012-03-26 12:47 ` Andreas Färber
2012-03-26 12:57   ` Wanpeng Li
2012-03-26 17:09 ` Blue Swirl
2012-03-26 17:35   ` Anthony Liguori
2012-03-26 17:43     ` Blue Swirl
2012-03-26 17:45       ` Anthony Liguori
2012-03-26 18:01         ` Blue Swirl
2012-03-26 18:07           ` Anthony Liguori
2012-03-26 18:25             ` Blue Swirl
2012-03-26 17:25 ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2012-03-26  8:34 [Qemu-devel] [PATCH 3/6] convert pci-host to QOM y
2012-03-26  9:05 Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F707C4C.4030602@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=liwp@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shangw@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).