From: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: marcel@redhat.com, armbru@redhat.com, qemu-ppc@nongnu.org,
agraf@suse.de, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 2/2] change type of pci_bridge_initfn() to void
Date: Sun, 17 Jan 2016 15:25:01 +0200 [thread overview]
Message-ID: <569B962D.20400@gmail.com> (raw)
In-Reply-To: <1452824612-29465-3-git-send-email-caoj.fnst@cn.fujitsu.com>
On 01/15/2016 04:23 AM, Cao jin wrote:
> Since it can`t fail. Also modify the callers.
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> ---
> hw/pci-bridge/i82801b11.c | 5 +----
> hw/pci-bridge/ioh3420.c | 6 +-----
> hw/pci-bridge/pci_bridge_dev.c | 8 +++-----
> hw/pci-bridge/xio3130_downstream.c | 6 +-----
> hw/pci-bridge/xio3130_upstream.c | 6 +-----
> hw/pci-host/apb.c | 7 +------
> hw/pci/pci_bridge.c | 3 +--
> include/hw/pci/pci_bridge.h | 2 +-
> 8 files changed, 10 insertions(+), 33 deletions(-)
>
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 7e79bc0..b21bc2c 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -61,10 +61,7 @@ static int i82801b11_bridge_initfn(PCIDevice *d)
> {
> int rc;
>
> - rc = pci_bridge_initfn(d, TYPE_PCI_BUS);
> - if (rc < 0) {
> - return rc;
> - }
> + pci_bridge_initfn(d, TYPE_PCI_BUS);
>
> rc = pci_bridge_ssvid_init(d, I82801ba_SSVID_OFFSET,
> I82801ba_SSVID_SVID, I82801ba_SSVID_SSID);
> diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
> index cce2fdd..eead195 100644
> --- a/hw/pci-bridge/ioh3420.c
> +++ b/hw/pci-bridge/ioh3420.c
> @@ -97,11 +97,7 @@ static int ioh3420_initfn(PCIDevice *d)
> PCIESlot *s = PCIE_SLOT(d);
> int rc;
>
> - rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
> - if (rc < 0) {
> - return rc;
> - }
> -
> + pci_bridge_initfn(d, TYPE_PCIE_BUS);
> pcie_port_init_reg(d);
>
> rc = pci_bridge_ssvid_init(d, IOH_EP_SSVID_OFFSET,
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index 26aded9..bc3e1b7 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -52,10 +52,8 @@ static int pci_bridge_dev_initfn(PCIDevice *dev)
> PCIBridgeDev *bridge_dev = PCI_BRIDGE_DEV(dev);
> int err;
>
> - err = pci_bridge_initfn(dev, TYPE_PCI_BUS);
> - if (err) {
> - goto bridge_error;
> - }
> + pci_bridge_initfn(dev, TYPE_PCI_BUS);
> +
> if (bridge_dev->flags & (1 << PCI_BRIDGE_DEV_F_SHPC_REQ)) {
> dev->config[PCI_INTERRUPT_PIN] = 0x1;
> memory_region_init(&bridge_dev->bar, OBJECT(dev), "shpc-bar",
> @@ -94,7 +92,7 @@ slotid_error:
> }
> shpc_error:
> pci_bridge_exitfn(dev);
> -bridge_error:
> +
> return err;
> }
>
> diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
> index b3a6479..b4dd25f 100644
> --- a/hw/pci-bridge/xio3130_downstream.c
> +++ b/hw/pci-bridge/xio3130_downstream.c
> @@ -60,11 +60,7 @@ static int xio3130_downstream_initfn(PCIDevice *d)
> PCIESlot *s = PCIE_SLOT(d);
> int rc;
>
> - rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
> - if (rc < 0) {
> - return rc;
> - }
> -
> + pci_bridge_initfn(d, TYPE_PCIE_BUS);
> pcie_port_init_reg(d);
>
> rc = msi_init(d, XIO3130_MSI_OFFSET, XIO3130_MSI_NR_VECTOR,
> diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
> index eada582..434c8fd 100644
> --- a/hw/pci-bridge/xio3130_upstream.c
> +++ b/hw/pci-bridge/xio3130_upstream.c
> @@ -56,11 +56,7 @@ static int xio3130_upstream_initfn(PCIDevice *d)
> PCIEPort *p = PCIE_PORT(d);
> int rc;
>
> - rc = pci_bridge_initfn(d, TYPE_PCIE_BUS);
> - if (rc < 0) {
> - return rc;
> - }
> -
> + pci_bridge_initfn(d, TYPE_PCIE_BUS);
> pcie_port_init_reg(d);
>
> rc = msi_init(d, XIO3130_MSI_OFFSET, XIO3130_MSI_NR_VECTOR,
> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
> index 599768e..0a53137 100644
> --- a/hw/pci-host/apb.c
> +++ b/hw/pci-host/apb.c
> @@ -634,12 +634,7 @@ static void pci_apb_set_irq(void *opaque, int irq_num, int level)
>
> static int apb_pci_bridge_initfn(PCIDevice *dev)
> {
> - int rc;
> -
> - rc = pci_bridge_initfn(dev, TYPE_PCI_BUS);
> - if (rc < 0) {
> - return rc;
> - }
> + pci_bridge_initfn(dev, TYPE_PCI_BUS);
>
> /*
> * command register:
> diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
> index 40c97b1..5c30795 100644
> --- a/hw/pci/pci_bridge.c
> +++ b/hw/pci/pci_bridge.c
> @@ -332,7 +332,7 @@ void pci_bridge_reset(DeviceState *qdev)
> }
>
> /* default qdev initialization function for PCI-to-PCI bridge */
> -int pci_bridge_initfn(PCIDevice *dev, const char *typename)
> +void pci_bridge_initfn(PCIDevice *dev, const char *typename)
> {
> PCIBus *parent = dev->bus;
> PCIBridge *br = PCI_BRIDGE(dev);
> @@ -378,7 +378,6 @@ int pci_bridge_initfn(PCIDevice *dev, const char *typename)
> br->windows = pci_bridge_region_init(br);
> QLIST_INIT(&sec_bus->child);
> QLIST_INSERT_HEAD(&parent->child, sec_bus, sibling);
> - return 0;
> }
>
> /* default qdev clean up function for PCI-to-PCI bridge */
> diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h
> index 93b621c..ed4aff6 100644
> --- a/include/hw/pci/pci_bridge.h
> +++ b/include/hw/pci/pci_bridge.h
> @@ -48,7 +48,7 @@ void pci_bridge_disable_base_limit(PCIDevice *dev);
> void pci_bridge_reset_reg(PCIDevice *dev);
> void pci_bridge_reset(DeviceState *qdev);
>
> -int pci_bridge_initfn(PCIDevice *pci_dev, const char *typename);
> +void pci_bridge_initfn(PCIDevice *pci_dev, const char *typename);
> void pci_bridge_exitfn(PCIDevice *pci_dev);
>
>
>
Looks OK to me,
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Thanks,
Marcel
next prev parent reply other threads:[~2016-01-17 13:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 2:23 [Qemu-devel] [PATCH v4 0/2] change type of pci_bridge_initfn() Cao jin
2016-01-15 2:23 ` [Qemu-devel] [PATCH v4 1/2] dec: convert to realize() Cao jin
2016-01-15 2:23 ` [Qemu-devel] [PATCH v4 2/2] change type of pci_bridge_initfn() to void Cao jin
2016-01-17 13:25 ` Marcel Apfelbaum [this message]
2016-02-05 1:28 ` [Qemu-devel] [PATCH v4 0/2] change type of pci_bridge_initfn() Cao jin
2016-02-15 11:32 ` Michael S. Tsirkin
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=569B962D.20400@gmail.com \
--to=marcel.apfelbaum@gmail.com \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=caoj.fnst@cn.fujitsu.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.