From nobody Sat Feb 7 06:39:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492466638342837.8441394502906; Mon, 17 Apr 2017 15:03:58 -0700 (PDT) Received: from localhost ([::1]:38935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0EkW-0003SS-HY for importer@patchew.org; Mon, 17 Apr 2017 18:03:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0EgL-0000PP-KP for qemu-devel@nongnu.org; Mon, 17 Apr 2017 17:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0EgI-0005mU-L1 for qemu-devel@nongnu.org; Mon, 17 Apr 2017 17:59:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d0EgI-0005mI-ER for qemu-devel@nongnu.org; Mon, 17 Apr 2017 17:59:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EE777FD6F; Mon, 17 Apr 2017 21:59:33 +0000 (UTC) Received: from localhost (ovpn-116-4.gru2.redhat.com [10.97.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76E14171F7; Mon, 17 Apr 2017 21:59:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4EE777FD6F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ehabkost@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4EE777FD6F From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Mon, 17 Apr 2017 18:59:11 -0300 Message-Id: <20170417215916.12431-3-ehabkost@redhat.com> In-Reply-To: <20170417215916.12431-1-ehabkost@redhat.com> References: <20170417215916.12431-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 17 Apr 2017 21:59:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC 2/7] pci: Change pci_bus_init() 'parent' parameter to PCIHostState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, David Gibson , Laszlo Ersek , Marcel Apfelbaum , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" pci_bus_init() already requires 'parent' to be a PCI_HOST_BRIDGE object, so change the parameter type to reflect that. Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: Eduardo Habkost Reviewed-by: David Gibson Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 25118fb91d..d9535c0bdc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -362,7 +362,7 @@ const char *pci_root_bus_path(PCIDevice *dev) return rootbus->qbus.name; } =20 -static void pci_bus_init(PCIBus *bus, DeviceState *parent, +static void pci_bus_init(PCIBus *bus, PCIHostState *phb, MemoryRegion *address_space_mem, MemoryRegion *address_space_io, uint8_t devfn_min) @@ -375,7 +375,7 @@ static void pci_bus_init(PCIBus *bus, DeviceState *pare= nt, /* host bridge */ QLIST_INIT(&bus->child); =20 - pci_host_bus_register(PCI_HOST_BRIDGE(host)); + pci_host_bus_register(phb); } =20 bool pci_bus_is_express(PCIBus *bus) @@ -394,8 +394,9 @@ void pci_bus_new_inplace(PCIBus *bus, size_t bus_size, = DeviceState *parent, MemoryRegion *address_space_io, uint8_t devfn_min, const char *typename) { + PCIHostState *phb =3D PCI_HOST_BRIDGE(parent); qbus_create_inplace(bus, bus_size, typename, parent, name); - pci_bus_init(bus, parent, address_space_mem, address_space_io, devfn_m= in); + pci_bus_init(bus, phb, address_space_mem, address_space_io, devfn_min); } =20 PCIBus *pci_bus_new(DeviceState *parent, const char *name, @@ -403,10 +404,11 @@ PCIBus *pci_bus_new(DeviceState *parent, const char *= name, MemoryRegion *address_space_io, uint8_t devfn_min, const char *typename) { + PCIHostState *phb =3D PCI_HOST_BRIDGE(parent); PCIBus *bus; =20 bus =3D PCI_BUS(qbus_create(typename, parent, name)); - pci_bus_init(bus, parent, address_space_mem, address_space_io, devfn_m= in); + pci_bus_init(bus, phb, address_space_mem, address_space_io, devfn_min); return bus; } =20 --=20 2.11.0.259.g40922b1