From nobody Mon Feb 9 12:45:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1609802941; cv=none; d=zohomail.com; s=zohoarc; b=Kle+NvUYaGszRHiE3uLr+q0ISxkxOIjagsd7tvQ0DH4yTRs0YxKfx8xEvF+kez6j0Xuvjn3BQDXzW1/UYKKPfMhvE8768XxLCLP2NPlt3/X4XG2Ee/zisBO2ea3AidNGA2EtpjBMkYen/wGJytBeD1ckqApbhvK14fUki13EyZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609802941; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9MdlFu6oL8gjGl9vDzIqP3VvRV4QVJ5HedQI6g9XNMU=; b=PlyTpguLeaCbIKP7WHu3FtZJHR9nrKhOO98bIY9ycqZPYz/Mtg58VZt9Cir7PcROEbZZxJ+skWUzSPDuoMOPQAVc4W2ke8gKuSZVwwr31IK9d5XpXCY8YCTJbFR7gpmf5cKeWoYFdZFHFxifoql//MbMJV/pzob5e7cvGdRIf0Y= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1609802941343293.8412826048685; Mon, 4 Jan 2021 15:29:01 -0800 (PST) Received: from localhost ([::1]:43792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwZHY-0002XY-7P for importer@patchew.org; Mon, 04 Jan 2021 18:29:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwZCD-00067N-Hf; Mon, 04 Jan 2021 18:23:34 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]:55654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwZC7-0007yj-PY; Mon, 04 Jan 2021 18:23:29 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 6DA8A7470E8; Tue, 5 Jan 2021 00:23:20 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 21EBA7470E2; Tue, 5 Jan 2021 00:23:20 +0100 (CET) Message-Id: <10c86eeab2090f81cdccb1f2197287ba4d799319.1609802040.git.balaton@eik.bme.hu> In-Reply-To: References: Subject: [PATCH v4 4/4] sam460ex: Use type cast macro instead of simple cast Date: Tue, 05 Jan 2021 00:14:00 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org X-Spam-Probability: 8% Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , f4bug@amsat.org, Guenter Roeck , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: BALATON Zoltan From: BALATON Zoltan via Content-Type: text/plain; charset="utf-8" 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 PCI_BUS macro also checks its argument by default so this shouldn't fail here. Signed-off-by: BALATON Zoltan --- 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 14e6583eb0..cc67e9c39b 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -384,11 +384,8 @@ static void sam460ex_init(MachineState *machine) ppc460ex_pcie_init(env); /* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */ dev =3D sysbus_create_simple("ppc440-pcix-host", 0xc0ec00000, uic[1][0= ]); - pci_bus =3D (PCIBus *)qdev_get_child_bus(dev, "pci.0"); - if (!pci_bus) { - error_report("couldn't create PCI controller!"); - exit(1); - } + pci_bus =3D 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); --=20 2.21.3