From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Anthony Liguori <aliguori@amazon.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH arm-devs v4 4/4] cpu/a9mpcore: Add Global Timer
Date: Mon, 02 Dec 2013 14:08:38 +0100 [thread overview]
Message-ID: <529C8656.4040406@suse.de> (raw)
In-Reply-To: <ff92f35f438ac671b57d99d823723dd3e62d2c49.1385969450.git.peter.crosthwaite@xilinx.com>
Hi,
A general observation...
Am 02.12.2013 08:37, schrieb Peter Crosthwaite:
> diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
> index a38464b..c09358c 100644
> --- a/hw/cpu/a9mpcore.c
> +++ b/hw/cpu/a9mpcore.c
> @@ -30,6 +30,9 @@ static void a9mp_priv_initfn(Object *obj)
> object_initialize(&s->gic, sizeof(s->gic), TYPE_ARM_GIC);
> qdev_set_parent_bus(DEVICE(&s->gic), sysbus_get_default());
>
> + object_initialize(&s->gtimer, sizeof(s->gtimer), TYPE_A9_GTIMER);
> + qdev_set_parent_bus(DEVICE(&s->gtimer), sysbus_get_default());
> +
> object_initialize(&s->mptimer, sizeof(s->mptimer), TYPE_ARM_MPTIMER);
> qdev_set_parent_bus(DEVICE(&s->mptimer), sysbus_get_default());
>
This code resulted from inlining qdev_create() and switching to in-place
instantiation.
Seeing this repetitive code again and again makes me wonder whether we
can just set a SysBusDevice's parent_bus in its instance_init function
to simplify it?
The only downsides I can think of is that SysBus can't instantiate
SysBusDevices in its instance_init then to avoid a circular dependency
and that the global SysBus might get a few refs more if set both in
instance_init and via qdev_set_parent_bus(), but we're not expecting it
to be destroyed anyway. CC'ing Paolo.
Outside the scope of this patch, obviously.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-12-02 13:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 7:34 [Qemu-devel] [PATCH arm-devs v4 0/4] A9 global timer + mpcore trivials Peter Crosthwaite
2013-12-02 7:35 ` [Qemu-devel] [PATCH arm-devs v4 1/4] cpu/a9mpcore: rename timerbusdev variable Peter Crosthwaite
2013-12-02 7:36 ` [Qemu-devel] [PATCH arm-devs v4 2/4] cpu/a9mpcore: reorder operations/declarations Peter Crosthwaite
2013-12-02 7:36 ` [Qemu-devel] [PATCH arm-devs v4 3/4] hw/timer: Introduce ARM A9 Global Timer Peter Crosthwaite
2013-12-02 12:28 ` Andreas Färber
2013-12-02 12:36 ` Peter Maydell
2013-12-02 12:59 ` Markus Armbruster
2013-12-02 13:05 ` Peter Maydell
2013-12-02 7:37 ` [Qemu-devel] [PATCH arm-devs v4 4/4] cpu/a9mpcore: Add " Peter Crosthwaite
2013-12-02 13:08 ` Andreas Färber [this message]
2013-12-02 13:21 ` Paolo Bonzini
2013-12-02 13:56 ` Andreas Färber
2013-12-02 11:58 ` [Qemu-devel] [PATCH arm-devs v4 0/4] A9 global timer + mpcore trivials Peter Maydell
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=529C8656.4040406@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.