qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-4.1 1/2] spapr_pci: Get rid of duplicate code for node name creation
@ 2019-04-05 16:30 Greg Kurz
  2019-04-05 16:30 ` Greg Kurz
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Greg Kurz @ 2019-04-05 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, David Gibson

According to the changelog of 298a971024534, SpaprPhbState::dtbusname was
introduced to "make it easier to relate the guest and qemu views of memory
to each other", hence its name.

Use it when creating the PHB node to avoid code duplication.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr_pci.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index bba3a86dda6c..c70688a0dc23 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -2153,7 +2153,6 @@ int spapr_populate_pci_dt(SpaprPhbState *phb, uint32_t intc_phandle, void *fdt,
                           uint32_t nr_msis, int *node_offset)
 {
     int bus_off, i, j, ret;
-    gchar *nodename;
     uint32_t bus_range[] = { cpu_to_be32(0), cpu_to_be32(0xff) };
     struct {
         uint32_t hi;
@@ -2204,9 +2203,7 @@ int spapr_populate_pci_dt(SpaprPhbState *phb, uint32_t intc_phandle, void *fdt,
     Error *errp = NULL;
 
     /* Start populating the FDT */
-    nodename = g_strdup_printf("pci@%" PRIx64, phb->buid);
-    _FDT(bus_off = fdt_add_subnode(fdt, 0, nodename));
-    g_free(nodename);
+    _FDT(bus_off = fdt_add_subnode(fdt, 0, phb->dtbusname));
     if (node_offset) {
         *node_offset = bus_off;
     }

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-10  0:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-05 16:30 [Qemu-devel] [PATCH for-4.1 1/2] spapr_pci: Get rid of duplicate code for node name creation Greg Kurz
2019-04-05 16:30 ` Greg Kurz
2019-04-05 16:30 ` [Qemu-devel] [PATCH for-4.1 2/2] spapr: Drop duplicate code in LSI mapping Greg Kurz
2019-04-05 16:30   ` Greg Kurz
2019-04-08  3:40   ` David Gibson
2019-04-08  3:40     ` David Gibson
2019-04-08 15:01     ` Greg Kurz
2019-04-08 15:01       ` Greg Kurz
2019-04-10  0:40       ` David Gibson
2019-04-10  0:40         ` David Gibson
2019-04-08  3:38 ` [Qemu-devel] [PATCH for-4.1 1/2] spapr_pci: Get rid of duplicate code for node name creation David Gibson
2019-04-08  3:38   ` David Gibson

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).