qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: peter.maydell@linaro.org,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH arm-devs v4 4/4] cpu/a9mpcore: Add Global Timer
Date: Mon, 02 Dec 2013 14:21:59 +0100	[thread overview]
Message-ID: <529C8977.4030808@redhat.com> (raw)
In-Reply-To: <529C8656.4040406@suse.de>

Il 02/12/2013 14:08, Andreas Färber ha scritto:
>> > +    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?

Could we do it instead in the init function, only if parent_bus is still
NULL?

Paolo

  reply	other threads:[~2013-12-02 13:22 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
2013-12-02 13:21     ` Paolo Bonzini [this message]
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=529C8977.4030808@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.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 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).