Received: from eggs.gnu.org ([208.118.235.92]:49849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBaZ-0000a7-3l for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWBaU-00025L-O5 for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41910 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWBaU-00024R-Iq for qemu-devel@nongnu.org; Sat, 27 Apr 2013 16:19:14 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 316B45E00020A for ; Sat, 27 Apr 2013 22:19:14 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 27 Apr 2013 22:18:45 +0200 Message-Id: <1367093935-29091-11-git-send-email-afaerber@suse.de> In-Reply-To: <1367093935-29091-1-git-send-email-afaerber@suse.de> References: <1367093935-29091-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-1.5 v2 10/20] parallel: QOM'ify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas F=C3=A4rber --- hw/char/parallel.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/char/parallel.c b/hw/char/parallel.c index b5e867f..8e48284 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -80,8 +80,13 @@ typedef struct ParallelState { int it_shift; } ParallelState; =20 +#define TYPE_ISA_PARALLEL "isa-parallel" +#define ISA_PARALLEL(obj) \ + OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL) + typedef struct ISAParallelState { - ISADevice dev; + ISADevice parent_obj; + uint32_t index; uint32_t iobase; uint32_t isairq; @@ -475,7 +480,7 @@ static const MemoryRegionPortio isa_parallel_portio_s= w_list[] =3D { static int parallel_isa_initfn(ISADevice *dev) { static int index; - ISAParallelState *isa =3D DO_UPCAST(ISAParallelState, dev, dev); + ISAParallelState *isa =3D ISA_PARALLEL(dev); ParallelState *s =3D &isa->state; int base; uint8_t dummy; @@ -600,7 +605,7 @@ static void parallel_isa_class_initfn(ObjectClass *kl= ass, void *data) } =20 static const TypeInfo parallel_isa_info =3D { - .name =3D "isa-parallel", + .name =3D TYPE_ISA_PARALLEL, .parent =3D TYPE_ISA_DEVICE, .instance_size =3D sizeof(ISAParallelState), .class_init =3D parallel_isa_class_initfn, --=20 1.8.1.4