From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnTS2-0004Up-L7 for qemu-devel@nongnu.org; Mon, 02 Dec 2013 08:22:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnTRw-0004eT-MB for qemu-devel@nongnu.org; Mon, 02 Dec 2013 08:22:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnTRw-0004eC-Ep for qemu-devel@nongnu.org; Mon, 02 Dec 2013 08:22:08 -0500 Message-ID: <529C8977.4030808@redhat.com> Date: Mon, 02 Dec 2013 14:21:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <529C8656.4040406@suse.de> In-Reply-To: <529C8656.4040406@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH arm-devs v4 4/4] cpu/a9mpcore: Add Global Timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: peter.maydell@linaro.org, Peter Crosthwaite , qemu-devel@nongnu.org, Anthony Liguori Il 02/12/2013 14:08, Andreas F=C3=A4rber 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_MPT= IMER); >> > qdev_set_parent_bus(DEVICE(&s->mptimer), sysbus_get_default()); >> > =20 > This code resulted from inlining qdev_create() and switching to in-plac= e > instantiation. >=20 > 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