All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH 03/16] ipack: Pass size to ipack_bus_new_inplace()
Date: Mon, 26 Aug 2013 15:23:10 +0800	[thread overview]
Message-ID: <521B025E.7050000@linux.vnet.ibm.com> (raw)
In-Reply-To: <1377302436-25193-4-git-send-email-afaerber@suse.de>

 > To be passed to qbus_create_inplace().
>
> Simplify DEVICE() cast to avoid parent field access.
   s->dev will always point to pci_dev, so this change is safe.

Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>


>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>   hw/char/ipack.c   | 3 ++-
>   hw/char/ipack.h   | 3 ++-
>   hw/char/tpci200.c | 2 +-
>   3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/hw/char/ipack.c b/hw/char/ipack.c
> index f890471..5fb7073 100644
> --- a/hw/char/ipack.c
> +++ b/hw/char/ipack.c
> @@ -24,7 +24,8 @@ IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot)
>       return NULL;
>   }
>
> -void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
> +void ipack_bus_new_inplace(IPackBus *bus, size_t bus_size,
> +                           DeviceState *parent,
>                              const char *name, uint8_t n_slots,
>                              qemu_irq_handler handler)
>   {
> diff --git a/hw/char/ipack.h b/hw/char/ipack.h
> index f2b7a12..f8dc0f2 100644
> --- a/hw/char/ipack.h
> +++ b/hw/char/ipack.h
> @@ -72,7 +72,8 @@ extern const VMStateDescription vmstate_ipack_device;
>       VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice)
>
>   IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot);
> -void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
> +void ipack_bus_new_inplace(IPackBus *bus, size_t bus_size,
> +                           DeviceState *parent,
>                              const char *name, uint8_t n_slots,
>                              qemu_irq_handler handler);
>
> diff --git a/hw/char/tpci200.c b/hw/char/tpci200.c
> index d9e17b2..e04ff26 100644
> --- a/hw/char/tpci200.c
> +++ b/hw/char/tpci200.c
> @@ -607,7 +607,7 @@ static int tpci200_initfn(PCIDevice *pci_dev)
>       pci_register_bar(&s->dev, 4, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las2);
>       pci_register_bar(&s->dev, 5, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->las3);
>
> -    ipack_bus_new_inplace(&s->bus, DEVICE(&s->dev), NULL,
> +    ipack_bus_new_inplace(&s->bus, sizeof(s->bus), DEVICE(pci_dev), NULL,
>                             N_MODULES, tpci200_set_irq);
>
>       return 0;
>


-- 
Best Regards

Wenchao Xia

  reply	other threads:[~2013-08-26  7:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-24  0:00 [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 01/16] qom: Fix object_initialize_with_type() argument name in documentation Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 02/16] intel-hda: Pass size to hda_codec_bus_init() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 03/16] ipack: Pass size to ipack_bus_new_inplace() Andreas Färber
2013-08-26  7:23   ` Wenchao Xia [this message]
2013-08-24  0:00 ` [Qemu-devel] [PATCH 04/16] ide: Pass size to ide_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 05/16] pci: Pass size to pci_bus_new_inplace() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 06/16] scsi: Pass size to scsi_bus_new() Andreas Färber
2013-08-26  8:01   ` Paolo Bonzini
2013-08-24  0:00 ` [Qemu-devel] [PATCH 07/16] usb: Pass size to usb_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 08/16] virtio-pci: Pass size to virtio_pci_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 09/16] s390-virtio-bus: Pass size to virtio_s390_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 10/16] virtio-ccw: Pass size to virtio_ccw_bus_new() Andreas Färber
2013-08-26  8:00   ` Cornelia Huck
2013-08-24  0:00 ` [Qemu-devel] [PATCH 11/16] virtio-mmio: Pass size to virtio_mmio_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 12/16] qdev: Pass size to qbus_create_inplace() Andreas Färber
2013-08-26  7:44   ` Wenchao Xia
2013-08-30 17:12     ` Andreas Färber
2013-08-26  8:03   ` Cornelia Huck
2013-08-30 17:05     ` Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 13/16] qom: Pass available size to object_initialize() Andreas Färber
2013-08-26  8:09   ` Cornelia Huck
2013-08-26  8:11   ` Wenchao Xia
2013-08-30 17:14     ` Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 14/16] qom: Introduce type_get_instance_size() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 15/16] qdev-monitor: Clean up qdev_device_add() variable naming Andreas Färber
2013-08-26  7:52   ` Wenchao Xia
2013-08-30 17:19     ` Andreas Färber
2013-09-12 14:40       ` Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 16/16] qdev-monitor: Avoid aborting on out-of-memory in qdev_device_add() Andreas Färber
2013-08-26  8:12 ` [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size Wenchao Xia
2013-08-30 19:37 ` Andreas Färber

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=521B025E.7050000@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.