From: Greg Kurz <groug@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: mdroth@linux.ibm.com, mst@redhat.com, qemu-ppc@nongnu.org,
clg@kaod.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/8] spapr: Clean up spapr_drc_populate_dt()
Date: Fri, 24 May 2019 18:59:11 +0200 [thread overview]
Message-ID: <20190524185911.22173b13@bahia.lan> (raw)
In-Reply-To: <20190523052918.1129-4-david@gibson.dropbear.id.au>
On Thu, 23 May 2019 15:29:14 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> This makes some minor cleanups to spapr_drc_populate_dt(), renaming it to
> the shorter and more idiomatic spapr_dt_drc() along the way.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/spapr.c | 7 +++----
> hw/ppc/spapr_drc.c | 13 ++++++-------
> hw/ppc/spapr_pci.c | 3 +--
> include/hw/ppc/spapr_drc.h | 3 +--
> 4 files changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 44573adce7..507fd50dd5 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1320,13 +1320,12 @@ static void *spapr_build_fdt(SpaprMachineState *spapr)
> spapr_populate_cpus_dt_node(fdt, spapr);
>
> if (smc->dr_lmb_enabled) {
> - _FDT(spapr_drc_populate_dt(fdt, 0, NULL, SPAPR_DR_CONNECTOR_TYPE_LMB));
> + _FDT(spapr_dt_drc(fdt, 0, NULL, SPAPR_DR_CONNECTOR_TYPE_LMB));
> }
>
> if (mc->has_hotpluggable_cpus) {
> int offset = fdt_path_offset(fdt, "/cpus");
> - ret = spapr_drc_populate_dt(fdt, offset, NULL,
> - SPAPR_DR_CONNECTOR_TYPE_CPU);
> + ret = spapr_dt_drc(fdt, offset, NULL, SPAPR_DR_CONNECTOR_TYPE_CPU);
> if (ret < 0) {
> error_report("Couldn't set up CPU DR device tree properties");
> exit(1);
> @@ -1363,7 +1362,7 @@ static void *spapr_build_fdt(SpaprMachineState *spapr)
> }
>
> if (smc->dr_phb_enabled) {
> - ret = spapr_drc_populate_dt(fdt, 0, NULL, SPAPR_DR_CONNECTOR_TYPE_PHB);
> + ret = spapr_dt_drc(fdt, 0, NULL, SPAPR_DR_CONNECTOR_TYPE_PHB);
> if (ret < 0) {
> error_report("Couldn't set up PHB DR device tree properties");
> exit(1);
> diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
> index 597f236b9c..bacadfcac5 100644
> --- a/hw/ppc/spapr_drc.c
> +++ b/hw/ppc/spapr_drc.c
> @@ -781,7 +781,7 @@ SpaprDrc *spapr_drc_by_id(const char *type, uint32_t id)
> }
>
> /**
> - * spapr_drc_populate_dt
> + * spapr_dt_drc
> *
> * @fdt: libfdt device tree
> * @path: path in the DT to generate properties
> @@ -794,8 +794,7 @@ SpaprDrc *spapr_drc_by_id(const char *type, uint32_t id)
> *
> * as documented in PAPR+ v2.1, 13.5.2
> */
> -int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
> - uint32_t drc_type_mask)
> +int spapr_dt_drc(void *fdt, int offset, Object *owner, uint32_t drc_type_mask)
> {
> Object *root_container;
> ObjectProperty *prop;
> @@ -873,7 +872,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
> *(uint32_t *)drc_names->str = cpu_to_be32(drc_count);
> *(uint32_t *)drc_types->str = cpu_to_be32(drc_count);
>
> - ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-indexes",
> + ret = fdt_setprop(fdt, offset, "ibm,drc-indexes",
> drc_indexes->data,
> drc_indexes->len * sizeof(uint32_t));
> if (ret) {
> @@ -881,7 +880,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
> goto out;
> }
>
> - ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-power-domains",
> + ret = fdt_setprop(fdt, offset, "ibm,drc-power-domains",
> drc_power_domains->data,
> drc_power_domains->len * sizeof(uint32_t));
> if (ret) {
> @@ -889,14 +888,14 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
> goto out;
> }
>
> - ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-names",
> + ret = fdt_setprop(fdt, offset, "ibm,drc-names",
> drc_names->str, drc_names->len);
> if (ret) {
> error_report("Couldn't finalize ibm,drc-names property");
> goto out;
> }
>
> - ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-types",
> + ret = fdt_setprop(fdt, offset, "ibm,drc-types",
> drc_types->str, drc_types->len);
> if (ret) {
> error_report("Couldn't finalize ibm,drc-types property");
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index c166df4145..04855d3125 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -2282,8 +2282,7 @@ int spapr_dt_phb(SpaprPhbState *phb, uint32_t intc_phandle, void *fdt,
> return ret;
> }
>
> - ret = spapr_drc_populate_dt(fdt, bus_off, OBJECT(phb),
> - SPAPR_DR_CONNECTOR_TYPE_PCI);
> + ret = spapr_dt_drc(fdt, bus_off, OBJECT(phb), SPAPR_DR_CONNECTOR_TYPE_PCI);
> if (ret) {
> return ret;
> }
> diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
> index fad0a887f9..c2c543a591 100644
> --- a/include/hw/ppc/spapr_drc.h
> +++ b/include/hw/ppc/spapr_drc.h
> @@ -266,8 +266,7 @@ SpaprDrc *spapr_dr_connector_new(Object *owner, const char *type,
> uint32_t id);
> SpaprDrc *spapr_drc_by_index(uint32_t index);
> SpaprDrc *spapr_drc_by_id(const char *type, uint32_t id);
> -int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
> - uint32_t drc_type_mask);
> +int spapr_dt_drc(void *fdt, int offset, Object *owner, uint32_t drc_type_mask);
>
> void spapr_drc_attach(SpaprDrc *drc, DeviceState *d, Error **errp);
> void spapr_drc_detach(SpaprDrc *drc);
next prev parent reply other threads:[~2019-05-24 17:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 5:29 [Qemu-devel] [PATCH 1/8] spapr: Clean up device node name generation for PCI devices David Gibson
2019-05-23 5:29 ` [Qemu-devel] [PATCH 2/8] spapr: Clean up device tree construction " David Gibson
2019-05-24 15:34 ` Greg Kurz
2019-05-30 2:07 ` David Gibson
2019-05-23 5:29 ` [Qemu-devel] [PATCH 3/8] spapr: Clean up dt creation for PCI buses David Gibson
2019-05-24 5:31 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2019-05-30 5:33 ` David Gibson
2019-05-30 5:43 ` Alexey Kardashevskiy
2019-05-31 10:24 ` David Gibson
2019-05-23 5:29 ` [Qemu-devel] [PATCH 4/8] spapr: Clean up spapr_drc_populate_dt() David Gibson
2019-05-24 16:59 ` Greg Kurz [this message]
2019-05-23 5:29 ` [Qemu-devel] [PATCH 5/8] spapr: Clean up DRC index construction David Gibson
2019-05-23 5:29 ` [Qemu-devel] [PATCH 6/8] spapr: Don't use bus number for building DRC ids David Gibson
2019-05-23 5:29 ` [Qemu-devel] [PATCH 7/8] spapr: Direct all PCI hotplug to host bridge, rather than P2P bridge David Gibson
2019-05-23 5:29 ` [Qemu-devel] [PATCH 8/8] spapr: Allow hot plug/unplug of PCI bridges and devices under PCI bridges David Gibson
2019-05-24 13:32 ` [Qemu-devel] [PATCH 1/8] spapr: Clean up device node name generation for PCI devices Greg Kurz
2019-05-30 1:50 ` David Gibson
2019-05-29 3:23 ` Michael S. Tsirkin
2019-05-29 3:24 ` Michael S. Tsirkin
2019-05-30 1:51 ` 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=20190524185911.22173b13@bahia.lan \
--to=groug@kaod.org \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=mdroth@linux.ibm.com \
--cc=mst@redhat.com \
--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: 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).