From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z06qZ-0006BN-Dm for qemu-devel@nongnu.org; Wed, 03 Jun 2015 07:28:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z06qW-0004Mo-7E for qemu-devel@nongnu.org; Wed, 03 Jun 2015 07:28:35 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:57595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z06qV-0004Jy-KD for qemu-devel@nongnu.org; Wed, 03 Jun 2015 07:28:32 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Jun 2015 21:28:29 +1000 From: Nikunj A Dadhania Date: Wed, 3 Jun 2015 16:55:57 +0530 Message-Id: <1433330757-6043-7-git-send-email-nikunj@linux.vnet.ibm.com> In-Reply-To: <1433330757-6043-1-git-send-email-nikunj@linux.vnet.ibm.com> References: <1433330757-6043-1-git-send-email-nikunj@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v6 6/6] spapr_pci: drop redundant args in spapr_populate_pci_child_dt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Cc: agraf@suse.de, thuth@redhat.com, nikunj@linux.vnet.ibm.com, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org * phb_index is not being used and if required can be obtained from sphb * use helper to get drc_index in this function Suggested-by: Alexey Kardashevskiy Signed-off-by: Nikunj A Dadhania --- hw/ppc/spapr_pci.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 986bb21..d2547a1 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -936,14 +936,17 @@ static void populate_resource_props(PCIDevice *d, ResourceProps *rp) rp->assigned_len = assigned_idx * sizeof(ResourceFields); } +static uint32_t spapr_phb_get_pci_drc_index(sPAPRPHBState *phb, + PCIDevice *pdev); + static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset, - int phb_index, int drc_index, sPAPRPHBState *sphb) { ResourceProps rp; bool is_bridge = false; int pci_status; char *buf = NULL; + uint32_t drc_index = spapr_phb_get_pci_drc_index(sphb, dev); if (pci_default_read_config(dev, PCI_HEADER_TYPE, 1) == PCI_HEADER_TYPE_BRIDGE) { @@ -1038,9 +1041,6 @@ typedef struct sPAPRFDT { sPAPRPHBState *sphb; } sPAPRFDT; -static uint32_t spapr_phb_get_pci_drc_index(sPAPRPHBState *phb, - PCIDevice *pdev); - /* create OF node for pci device and required OF DT properties */ static int spapr_create_pci_child_dt(PCIDevice *dev, sPAPRFDT *p) { @@ -1048,7 +1048,6 @@ static int spapr_create_pci_child_dt(PCIDevice *dev, sPAPRFDT *p) int slot = PCI_SLOT(dev->devfn); int func = PCI_FUNC(dev->devfn); char nodename[FDT_NAME_MAX]; - uint32_t drc_index = spapr_phb_get_pci_drc_index(p->sphb, dev); if (func != 0) { snprintf(nodename, FDT_NAME_MAX, "pci@%x,%x", slot, func); @@ -1056,8 +1055,7 @@ static int spapr_create_pci_child_dt(PCIDevice *dev, sPAPRFDT *p) snprintf(nodename, FDT_NAME_MAX, "pci@%x", slot); } offset = fdt_add_subnode(p->fdt, p->node_off, nodename); - ret = spapr_populate_pci_child_dt(dev, p->fdt, offset, p->sphb->index, - drc_index, p->sphb); + ret = spapr_populate_pci_child_dt(dev, p->fdt, offset, p->sphb); g_assert(!ret); if (ret) { return 0; -- 1.8.3.1