From: "Andreas Färber" <afaerber@suse.de>
To: Hu Tao <hutao@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH qom-next for-1.6 7/8] pl110: QOM'ify pl110, pl110_versatile and pl111
Date: Fri, 26 Jul 2013 14:40:47 +0200 [thread overview]
Message-ID: <51F26E4F.2040002@suse.de> (raw)
In-Reply-To: <20130726025800.GD10249@localhost.localdomain>
Am 26.07.2013 04:58, schrieb Hu Tao:
> On Thu, Jul 25, 2013 at 01:16:51AM +0200, Andreas Färber wrote:
>> Let pl110_versatile and pl111 inherit from pl110 and use PL110() cast;
>> set their version index in an instance_init.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> hw/display/pl110.c | 71 ++++++++++++++++++++++--------------------------------
>> 1 file changed, 29 insertions(+), 42 deletions(-)
>>
>
> <...>
>
>> -static int pl110_init(SysBusDevice *dev)
>> +static int pl110_init(SysBusDevice *sbd)
>> {
>> - PL110State *s = FROM_SYSBUS(PL110State, dev);
>> + DeviceState *dev = DEVICE(sbd);
>> + PL110State *s = PL110(dev);
>>
>> memory_region_init_io(&s->iomem, OBJECT(s), &pl110_ops, s, "pl110", 0x1000);
>> - sysbus_init_mmio(dev, &s->iomem);
>> - sysbus_init_irq(dev, &s->irq);
>> - qdev_init_gpio_in(&s->busdev.qdev, pl110_mux_ctrl_set, 1);
>> - s->con = graphic_console_init(DEVICE(dev), &pl110_gfx_ops, s);
>> + sysbus_init_mmio(sbd, &s->iomem);
>> + sysbus_init_irq(sbd, &s->irq);
>> + qdev_init_gpio_in(dev, pl110_mux_ctrl_set, 1);
>> + s->con = graphic_console_init(dev, &pl110_gfx_ops, s);
>> return 0;
>
> Would it be better to explicitly set PL110 version? I know PL110 is 0,
> but it's not like a normal variable which is always good to be
> initialized to 0, assuming a version number is bad. (This is not a problem
> of this patch)
Sure, I can add such a no-op line. Thanks for your watchful review!
However I'd like to point out that these series are tailored for 1.6, so
I tried to go with a "safe" set of changes (e.g., leaving out most QOM
realize conversions). I think a post-1.6 cleanup would be to move such
static instance fields into a new PL110Class, set in different
..._class_init rather than ..._init functions.
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-07-26 12:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 23:16 [Qemu-devel] [PATCH qom-next for-1.6 0/8] display: QOM cast cleanups Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 1/8] exynos4210_fimd: QOM cast cleanup Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 2/8] g364fb: " Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 3/8] jazz_led: QOM cast cleanups Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 4/8] milkymist-tmu2: " Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 5/8] milkymist-vgafb: " Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 6/8] pl110: Rename pl110_state to PL110State Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 7/8] pl110: QOM'ify pl110, pl110_versatile and pl111 Andreas Färber
2013-07-26 2:58 ` Hu Tao
2013-07-26 12:40 ` Andreas Färber [this message]
2013-07-27 18:25 ` Andreas Färber
2013-07-24 23:16 ` [Qemu-devel] [PATCH qom-next for-1.6 8/8] tcx: QOM cast cleanups Andreas Färber
2013-07-26 3:05 ` [Qemu-devel] [PATCH qom-next for-1.6 0/8] display: " Hu Tao
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=51F26E4F.2040002@suse.de \
--to=afaerber@suse.de \
--cc=hutao@cn.fujitsu.com \
--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).