From: David Gibson <david@gibson.dropbear.id.au> To: Greg Kurz <groug@kaod.org> Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: Re: [Qemu-devel] [PATCH for-4.1 1/2] spapr_pci: Get rid of duplicate code for node name creation Date: Mon, 8 Apr 2019 13:38:07 +1000 [thread overview] Message-ID: <20190408033807.GA16627@umbus.fritz.box> (raw) In-Reply-To: <155448184292.8446.8225650773162648595.stgit@bahia.lan> [-- Attachment #1: Type: text/plain, Size: 1651 bytes --] On Fri, Apr 05, 2019 at 06:30:43PM +0200, Greg Kurz wrote: > 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> Applied, thanks. > --- > 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; > } > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: David Gibson <david@gibson.dropbear.id.au> To: Greg Kurz <groug@kaod.org> Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH for-4.1 1/2] spapr_pci: Get rid of duplicate code for node name creation Date: Mon, 8 Apr 2019 13:38:07 +1000 [thread overview] Message-ID: <20190408033807.GA16627@umbus.fritz.box> (raw) Message-ID: <20190408033807.ADyB5JgoPiGkSL7zloIqmGDLCxIDu1s04RJlqEuNv4I@z> (raw) In-Reply-To: <155448184292.8446.8225650773162648595.stgit@bahia.lan> [-- Attachment #1: Type: text/plain, Size: 1651 bytes --] On Fri, Apr 05, 2019 at 06:30:43PM +0200, Greg Kurz wrote: > 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> Applied, thanks. > --- > 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; > } > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-04-08 4:29 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 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 ` David Gibson [this message] 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
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=20190408033807.GA16627@umbus.fritz.box \ --to=david@gibson.dropbear.id.au \ --cc=groug@kaod.org \ --cc=qemu-devel@nongnu.org \ --cc=qemu-ppc@nongnu.org \ /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: linkBe 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).