All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org, groug@kaod.org
Cc: David Gibson <david@gibson.dropbear.id.au>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: [PULL 08/13] sam460ex: Use type cast macro instead of simple cast
Date: Tue, 19 Jan 2021 17:23:13 +1100	[thread overview]
Message-ID: <20210119062318.13857-9-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20210119062318.13857-1-david@gibson.dropbear.id.au>

From: BALATON Zoltan <balaton@eik.bme.hu>

Use the PCI_BUS type cast macro to convert result of qdev_get_child_bus().
Also remove the check for NULL afterwards which should not be needed
because sysbus_create_simple() uses error_abort and we create the PCI
host object here that's expected to have a PCI bus so this shouldn't
fail. Even if it would fail that would be due to a programmer error so
an error message is not necessary.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <a4dc55b56eed3ce899b7bf9835b980a114c52598.1610143658.git.balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/sam460ex.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 45721ad6c7..e459b43065 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -419,11 +419,8 @@ static void sam460ex_init(MachineState *machine)
     /* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */
     dev = sysbus_create_simple("ppc440-pcix-host", 0xc0ec00000,
                                qdev_get_gpio_in(uic[1], 0));
-    pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
-    if (!pci_bus) {
-        error_report("couldn't create PCI controller!");
-        exit(1);
-    }
+    pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
+
     memory_region_init_alias(isa, NULL, "isa_mmio", get_system_io(),
                              0, 0x10000);
     memory_region_add_subregion(get_system_memory(), 0xc08000000, isa);
-- 
2.29.2



  parent reply	other threads:[~2021-01-19  6:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  6:23 [PULL 00/13] ppc-for-6.0 queue 20210119 David Gibson
2021-01-19  6:23 ` [PULL 01/13] hw/ppc/sam460ex: Drop use of ppcuic_init() David Gibson
2021-01-19  6:23 ` [PULL 02/13] hw/ppc: Delete unused ppc405cr_init() code David Gibson
2021-01-19  6:23 ` [PULL 03/13] hw/intc/ppc-uic: Make default dcr-base 0xc0, not 0x30 David Gibson
2021-01-19  6:23 ` [PULL 04/13] hw/ppc/ppc405_uc: Drop use of ppcuic_init() David Gibson
2021-01-19  6:23 ` [PULL 05/13] hw/ppc: Remove unused ppcuic_init() David Gibson
2021-01-19  6:23 ` [PULL 06/13] Revert "sam460ex: Remove FDT_PPC dependency from KConfig" David Gibson
2021-01-19  6:23 ` [PULL 07/13] Revert "ppc4xx: Move common dependency on serial to common option" David Gibson
2021-01-19  6:23 ` David Gibson [this message]
2021-01-19  6:23 ` [PULL 09/13] spapr: Improve handling of memory unplug with old guests David Gibson
2021-01-19  6:23 ` [PULL 10/13] spapr.h: fix trailing whitespace in phb_placement David Gibson
2021-01-19  6:23 ` [PULL 11/13] spapr_hcall.c: make do_client_architecture_support static David Gibson
2021-01-19  6:23 ` [PULL 12/13] spapr_rtas.c: fix identation of rtas_ibm_suspend_me() args David Gibson
2021-01-19  6:23 ` [PULL 13/13] spapr_cpu_core.c: use g_auto* in spapr_create_vcpu() David Gibson
2021-01-19 11:53 ` [PULL 00/13] ppc-for-6.0 queue 20210119 Peter Maydell

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=20210119062318.13857-9-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=peter.maydell@linaro.org \
    --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.