qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
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
Subject: [Qemu-devel] [PATCH v6 6/6] spapr_pci: drop redundant args in spapr_populate_pci_child_dt
Date: Wed,  3 Jun 2015 16:55:57 +0530	[thread overview]
Message-ID: <1433330757-6043-7-git-send-email-nikunj@linux.vnet.ibm.com> (raw)
In-Reply-To: <1433330757-6043-1-git-send-email-nikunj@linux.vnet.ibm.com>

* 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 <aik@ozlabs.ru>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
 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

      parent reply	other threads:[~2015-06-03 11:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 11:25 [Qemu-devel] [PATCH v6 0/6] spapr_pci: DT field fixes and PCI DT node creation in QEMU Nikunj A Dadhania
2015-06-03 11:25 ` [Qemu-devel] [PATCH v6 1/6] spapr_pci: encode missing 64-bit memory address space Nikunj A Dadhania
2015-06-03 11:25 ` [Qemu-devel] [PATCH v6 2/6] spapr_pci: encode class code including Prog IF register Nikunj A Dadhania
2015-06-03 11:25 ` [Qemu-devel] [PATCH v6 3/6] spapr_pci: enumerate and add PCI device tree Nikunj A Dadhania
2015-06-03 11:25 ` [Qemu-devel] [PATCH v6 4/6] spapr_pci: set device node unit address as hex Nikunj A Dadhania
2015-06-03 17:23   ` Thomas Huth
2015-06-03 11:25 ` [Qemu-devel] [PATCH v6 5/6] spapr_pci: populate ibm,loc-code Nikunj A Dadhania
2015-06-03 17:40   ` Thomas Huth
2015-06-04  5:16     ` Nikunj A Dadhania
2015-06-03 11:25 ` Nikunj A Dadhania [this message]

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=1433330757-6043-7-git-send-email-nikunj@linux.vnet.ibm.com \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).