qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Alistair Francis" <alistair.francis@xilinx.com>,
	"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 9/9] hw/arm/xlnx-zynqmp: use Linux FDT names
Date: Tue, 9 Jan 2018 09:51:32 +0000	[thread overview]
Message-ID: <CAFEAcA-v8ZgCLmd2NB=6P2r-ZwsozsDsuFDuAC7DrJxp=ADRCw@mail.gmail.com> (raw)
In-Reply-To: <20180109020054.32553-10-f4bug@amsat.org>

On 9 January 2018 at 02:00, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/arm/xlnx-zynqmp.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 325642058b..fdcd6801b6 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -24,6 +24,7 @@
>  #include "exec/address-spaces.h"
>  #include "sysemu/kvm.h"
>  #include "kvm_arm.h"
> +#include "hw/sysbus-fdt.h"
>
>  #define GIC_NUM_SPI_INTR 160
>
> @@ -138,6 +139,7 @@ static void xlnx_zynqmp_init(Object *obj)
>      XlnxZynqMPState *s = XLNX_ZYNQMP(obj);
>      int i;
>      int num_apus = MIN(smp_cpus, XLNX_ZYNQMP_NUM_APU_CPUS);
> +    const char *type_name;
>
>      for (i = 0; i < num_apus; i++) {
>          object_initialize(&s->apu_cpu[i], sizeof(s->apu_cpu[i]),
> @@ -150,12 +152,14 @@ static void xlnx_zynqmp_init(Object *obj)
>      qdev_set_parent_bus(DEVICE(&s->gic), sysbus_get_default());
>
>      for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
> -        object_initialize(&s->gem[i], sizeof(s->gem[i]), TYPE_CADENCE_GEM);
> +        type_name = type_resolve_fdt_alias("cdns,zynqmp-gem");
> +        object_initialize(&s->gem[i], sizeof(s->gem[i]), type_name);
>          qdev_set_parent_bus(DEVICE(&s->gem[i]), sysbus_get_default());
>      }

I'm having difficulty seeing the benefits of this series. We spend
patches 1-8 adding code to devices to add alias names to them,
and this means that in patch 9 we can replace a single
object_initialize() with ... two lines of code including
a runtime lookup of an alias name. Can you explain why this
is better than what we have currently?

thanks
-- PMM

      reply	other threads:[~2018-01-09  9:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09  2:00 [Qemu-devel] [RFC PATCH v2 0/9] resolv device by Flattened Device Tree alias name Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 1/9] hw/sysbus: add helpers to register FDT aliases Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 2/9] hw/char/cadence_uart: add " Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 3/9] hw/net/cadence_gem: " Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 4/9] hw/timer/cadence_ttc: " Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 5/9] hw/dma/axidma: add 'xlnx, eth-dma' FDT alias Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 6/9] hw/usb/hcd-ehci: add 'xlnx, ps7-usb' FDT aliases Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 7/9] hw/ssi/xlnx-spips: add 'xlnx.zynq-qspi' FDT alias Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 8/9] hw/dma/xlnx_dpdma: add 'xlnx, axi-dpdma-1.0' " Philippe Mathieu-Daudé
2018-01-09  2:00 ` [Qemu-devel] [RFC PATCH v2 9/9] hw/arm/xlnx-zynqmp: use Linux FDT names Philippe Mathieu-Daudé
2018-01-09  9:51   ` Peter Maydell [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='CAFEAcA-v8ZgCLmd2NB=6P2r-ZwsozsDsuFDuAC7DrJxp=ADRCw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=afaerber@suse.de \
    --cc=alistair.francis@xilinx.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=imammedo@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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).