From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V39BS-00055j-J8 for qemu-devel@nongnu.org; Sat, 27 Jul 2013 14:25:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V39BK-0000LI-5m for qemu-devel@nongnu.org; Sat, 27 Jul 2013 14:25:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41929 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V39BJ-0000L2-Nw for qemu-devel@nongnu.org; Sat, 27 Jul 2013 14:25:30 -0400 Message-ID: <51F41093.4010601@suse.de> Date: Sat, 27 Jul 2013 20:25:23 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1374707812-21404-1-git-send-email-afaerber@suse.de> <1374707812-21404-8-git-send-email-afaerber@suse.de> <20130726025800.GD10249@localhost.localdomain> <51F26E4F.2040002@suse.de> In-Reply-To: <51F26E4F.2040002@suse.de> Content-Type: multipart/mixed; boundary="------------060103050003070902040507" Subject: Re: [Qemu-devel] [PATCH qom-next for-1.6 7/8] pl110: QOM'ify pl110, pl110_versatile and pl111 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------060103050003070902040507 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 26.07.2013 14:40, schrieb Andreas F=C3=A4rber: > Am 26.07.2013 04:58, schrieb Hu Tao: >> 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 pro= blem >> of this patch) >=20 > Sure, I can add such a no-op line. Thanks for your watchful review! Squashed the attached patch, that should address it. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg --------------060103050003070902040507 Content-Type: text/x-patch; name="00.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="00.diff" diff --git a/hw/display/pl110.c b/hw/display/pl110.c index c774e46..58a8ff1 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -457,7 +457,7 @@ static const GraphicHwOps pl110_gfx_ops = { .gfx_update = pl110_update_display, }; -static int pl110_init(SysBusDevice *sbd) +static int pl110_initfn(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); PL110State *s = PL110(dev); @@ -470,6 +470,13 @@ static int pl110_init(SysBusDevice *sbd) return 0; } +static void pl110_init(Object *obj) +{ + PL110State *s = PL110(obj); + + s->version = PL110; +} + static void pl110_versatile_init(Object *obj) { PL110State *s = PL110(obj); @@ -489,7 +496,7 @@ static void pl110_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = pl110_init; + k->init = pl110_initfn; dc->no_user = 1; dc->vmsd = &vmstate_pl110; } @@ -498,6 +505,7 @@ static const TypeInfo pl110_info = { .name = TYPE_PL110, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PL110State), + .instance_init = pl110_init, .class_init = pl110_class_init, }; --------------060103050003070902040507--