From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtDC8-0005ZT-1F for qemu-devel@nongnu.org; Sun, 30 Jun 2013 04:41:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtDC6-0008J4-W6 for qemu-devel@nongnu.org; Sun, 30 Jun 2013 04:41:15 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44479 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtDC6-0008Ix-Mm for qemu-devel@nongnu.org; Sun, 30 Jun 2013 04:41:14 -0400 Message-ID: <51CFEF25.4080300@suse.de> Date: Sun, 30 Jun 2013 10:41:09 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <566136fd00e29c95756d80eec288e3265b0da486.1372055322.git.peter.crosthwaite@xilinx.com> In-Reply-To: <566136fd00e29c95756d80eec288e3265b0da486.1372055322.git.peter.crosthwaite@xilinx.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 12/30] virtio/vmware_vga: QOM casting sweep List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.crosthwaite@xilinx.com Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, mst@redhat.com "display/vmware_vga: ..." obviously. Am 24.06.2013 08:58, schrieb peter.crosthwaite@xilinx.com: > From: Peter Crosthwaite >=20 > Define and use standard QOM cast macro. Remove usages of DO_UPCAST and > direct -> style casting. >=20 > Signed-off-by: Peter Crosthwaite > --- >=20 > hw/display/vmware_vga.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c > index fd3569d..0e2aa3f 100644 > --- a/hw/display/vmware_vga.c > +++ b/hw/display/vmware_vga.c > @@ -81,6 +81,11 @@ struct vmsvga_state_s { > int redraw_fifo_first, redraw_fifo_last; > }; > =20 > +#define TYPE_VM_SVGA "vmware-svga" > + > +#define VM_SVGA(obj) \ > + OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VM_SVGA) Let's use VMWARE_VGA for uniqueness. Thanks, applied to qom-next: https://github.com/afaerber/qemu-cpu/commits/qom-next Andreas > + > struct pci_vmsvga_state_s { > PCIDevice card; > struct vmsvga_state_s chip; > @@ -1092,8 +1097,7 @@ static void vmsvga_update_display(void *opaque) > =20 > static void vmsvga_reset(DeviceState *dev) > { > - struct pci_vmsvga_state_s *pci =3D > - DO_UPCAST(struct pci_vmsvga_state_s, card.qdev, dev); > + struct pci_vmsvga_state_s *pci =3D VM_SVGA(dev); > struct vmsvga_state_s *s =3D &pci->chip; > =20 > s->index =3D 0; > @@ -1246,8 +1250,7 @@ static const MemoryRegionOps vmsvga_io_ops =3D { > =20 > static int pci_vmsvga_initfn(PCIDevice *dev) > { > - struct pci_vmsvga_state_s *s =3D > - DO_UPCAST(struct pci_vmsvga_state_s, card, dev); > + struct pci_vmsvga_state_s *s =3D VM_SVGA(dev); > =20 > s->card.config[PCI_CACHE_LINE_SIZE] =3D 0x08; /* Cache lin= e size */ > s->card.config[PCI_LATENCY_TIMER] =3D 0x40; /* Latency t= imer */ > @@ -1299,7 +1302,7 @@ static void vmsvga_class_init(ObjectClass *klass,= void *data) > } > =20 > static const TypeInfo vmsvga_info =3D { > - .name =3D "vmware-svga", > + .name =3D TYPE_VM_SVGA, > .parent =3D TYPE_PCI_DEVICE, > .instance_size =3D sizeof(struct pci_vmsvga_state_s), > .class_init =3D vmsvga_class_init, >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg