qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-4.1 1/2] spapr_pci: Get rid of duplicate cod


From: David Gibson
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
User-agent: Mutt/1.11.3 (2019-02-01)

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 <address@hidden>

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("address@hidden" 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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]