Received: from eggs.gnu.org ([208.118.235.92]:47534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tuog2-0002lQ-Nx for qemu-devel@nongnu.org; Mon, 14 Jan 2013 13:22:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tuog1-0008Qq-Fq for qemu-devel@nongnu.org; Mon, 14 Jan 2013 13:22:30 -0500 From: Markus Armbruster References: <1358121304-21345-1-git-send-email-afaerber@suse.de> <1358121304-21345-9-git-send-email-afaerber@suse.de> <87ehho2b9o.fsf@blackfin.pond.sub.org> <50F430D6.5030008@suse.de> Date: Mon, 14 Jan 2013 18:30:34 +0100 In-Reply-To: <50F430D6.5030008@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22?= =?utf-8?Q?'s?= message of "Mon, 14 Jan 2013 17:22:46 +0100") Message-ID: <87d2x7pt8l.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC ppc-next v3 08/10] mac_nvram: QOM'ify MacIO NVRAM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de Andreas F=C3=A4rber writes: > Am 14.01.2013 13:34, schrieb Markus Armbruster: >> Andreas F=C3=A4rber writes: >>=20 >>> It was not qdev'ified before, turn it into a SysBusDevice and >>> initialize it via static properties. >>> >>> Prepare Old World specific MacIO state and embed the NVRAM state there. >>> >>> Drop macio_nvram_setup_bar() in favor of sysbus_mmio_map() or >>> direct use of Memory API. >> [...] >>> diff --git a/hw/macio.c b/hw/macio.c >>> index 0e6fc8d..32f359c 100644 >>> --- a/hw/macio.c >>> +++ b/hw/macio.c >> [...] >>> @@ -85,11 +93,22 @@ static int macio_common_initfn(PCIDevice *d) >>> static int macio_oldworld_initfn(PCIDevice *d) >>> { >>> MacIOState *s =3D MACIO(d); >>> + OldWorldMacIOState *os =3D OLDWORLD_MACIO(d); >>=20 >> I find aliasing pointers like these mildly confusing, and prefer to >> avoid aliases. Matter of taste, I guess. > > What would you propose instead? When accessing fields we are not > supposed to use FOO(x)->bar so I don't see any alternative. > (This notation was chosen I think because it is compatible with > C++/ObjC/... when exchanging the cast macro.) Isn't &os->parent_obj =3D=3D s ? s-> then becomes os->parent_obj. Repeat: matter of taste, use your judgement.