From: David Gibson <david@gibson.dropbear.id.au>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, aik@ozlabs.ru,
David Gibson <dgibson@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Laszlo Ersek <lersek@redhat.com>,
Marcel Apfelbaum <marcel@redhat.com>,
Alexander Graf <agraf@suse.de>,
Aurelien Jarno <aurelien@aurel32.net>,
qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [RFC v2 4/6] pci: Manually simplify QOM casts at pci_host_bus_init*() calls
Date: Wed, 19 Apr 2017 10:30:03 +1000 [thread overview]
Message-ID: <20170419003003.GD23273@umbus.fritz.box> (raw)
In-Reply-To: <20170418221724.5707-5-ehabkost@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3710 bytes --]
On Tue, Apr 18, 2017 at 07:17:22PM -0300, Eduardo Habkost wrote:
> Those redundant casts were not detected by the Coccinelle patch because
> there are multiple variables and casts involved. Fix them manually.
>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/pci-host/q35.c | 2 +-
> hw/pci-host/uninorth.c | 2 +-
> hw/ppc/spapr_pci.c | 2 +-
> hw/sh4/sh_pci.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index 947dc3f124..4258076979 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -49,7 +49,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
> sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
> sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
>
> - pci->bus = pci_host_bus_init(PCI_HOST_BRIDGE(s), "pcie.0",
> + pci->bus = pci_host_bus_init(pci, "pcie.0",
> s->mch.pci_address_space,
> s->mch.address_space_io, 0, TYPE_PCIE_BUS);
> PC_MACHINE(qdev_get_machine())->bus = pci->bus;
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index 079faad6ff..d9fb5fdc93 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -233,7 +233,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic,
> memory_region_add_subregion(address_space_mem, 0x80000000ULL,
> &d->pci_hole);
>
> - h->bus = pci_host_bus_init_irqs(PCI_HOST_BRIDGE(dev), NULL,
> + h->bus = pci_host_bus_init_irqs(h, NULL,
> pci_unin_set_irq, pci_unin_map_irq, pic,
> &d->pci_mmio, address_space_io,
> PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS);
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 7f29cc77b0..ce132c5eea 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1697,7 +1697,7 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
> memory_region_add_subregion(get_system_memory(), sphb->io_win_addr,
> &sphb->iowindow);
>
> - bus = pci_host_bus_init_irqs(PCI_HOST_BRIDGE(dev), NULL,
> + bus = pci_host_bus_init_irqs(phb, NULL,
> pci_spapr_set_irq, pci_spapr_map_irq, sphb,
> &sphb->memspace, &sphb->iospace,
> PCI_DEVFN(0, 0), PCI_NUM_PINS, TYPE_PCI_BUS);
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index f589b1628e..8be2e830e9 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -131,7 +131,7 @@ static int sh_pci_device_init(SysBusDevice *dev)
> for (i = 0; i < 4; i++) {
> sysbus_init_irq(dev, &s->irq[i]);
> }
> - phb->bus = pci_host_bus_init_irqs(PCI_HOST_BRIDGE(dev), "pci",
> + phb->bus = pci_host_bus_init_irqs(phb, "pci",
> sh_pci_set_irq, sh_pci_map_irq, s->irq,
> get_system_memory(), get_system_io(),
> PCI_DEVFN(0, 0), 4, TYPE_PCI_BUS);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-04-19 0:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 22:17 [Qemu-devel] [RFC v2 0/6] pci: Refactor PCI root bus creation code Eduardo Habkost
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 1/6] pci: Inline pci_host_bus_register() inside pci_bus_init() Eduardo Habkost
2017-04-19 0:22 ` David Gibson
2017-04-19 18:09 ` Marcel Apfelbaum
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 2/6] pci: Move pci_bus_init() logic to pci_bus_new_inplace() Eduardo Habkost
2017-04-19 0:23 ` David Gibson
2017-04-19 18:31 ` Marcel Apfelbaum
2017-04-25 19:24 ` Eduardo Habkost
2017-04-18 22:17 ` [Qemu-arm] [RFC v2 3/6] pci: Rename and change signatures of pci_bus_new() & related functions Eduardo Habkost
2017-04-18 22:17 ` [Qemu-devel] " Eduardo Habkost
2017-04-19 0:29 ` David Gibson
2017-04-19 0:29 ` David Gibson
2017-04-19 1:42 ` [Qemu-arm] " Eduardo Habkost
2017-04-19 1:42 ` [Qemu-devel] " Eduardo Habkost
2017-04-19 12:05 ` [Qemu-arm] " Cornelia Huck
2017-04-19 12:05 ` [Qemu-devel] " Cornelia Huck
2017-04-19 18:41 ` [Qemu-arm] " Marcel Apfelbaum
2017-04-19 18:41 ` [Qemu-devel] " Marcel Apfelbaum
2017-04-19 21:19 ` Eduardo Habkost
2017-04-19 21:19 ` Eduardo Habkost
2017-04-19 8:41 ` [Qemu-arm] " Peter Maydell
2017-04-19 8:41 ` [Qemu-devel] " Peter Maydell
2017-04-19 12:50 ` [Qemu-arm] " Eduardo Habkost
2017-04-19 12:50 ` [Qemu-devel] " Eduardo Habkost
2017-04-20 5:04 ` [Qemu-arm] " David Gibson
2017-04-20 5:04 ` [Qemu-devel] " David Gibson
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 4/6] pci: Manually simplify QOM casts at pci_host_bus_init*() calls Eduardo Habkost
2017-04-19 0:30 ` David Gibson [this message]
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 5/6] pci: Set phb->bus inside pci_host_bus_init_inplace() Eduardo Habkost
2017-04-18 22:17 ` Eduardo Habkost
2017-04-18 22:17 ` [Qemu-devel] [RFC v2 6/6] pci: Remove unnecessary PCIBus variables Eduardo Habkost
2017-04-19 12:20 ` Cornelia Huck
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=20170419003003.GD23273@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=aurelien@aurel32.net \
--cc=dgibson@redhat.com \
--cc=ehabkost@redhat.com \
--cc=lersek@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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.