From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtCxD-0003d6-Or for qemu-devel@nongnu.org; Sun, 30 Jun 2013 04:25:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtCxC-0003Cj-Sl for qemu-devel@nongnu.org; Sun, 30 Jun 2013 04:25:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44113 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtCxC-0003Cd-Jc for qemu-devel@nongnu.org; Sun, 30 Jun 2013 04:25:50 -0400 Message-ID: <51CFEB89.6080102@suse.de> Date: Sun, 30 Jun 2013 10:25:45 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 09/30] ide/piix: 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 Am 24.06.2013 08:56, schrieb peter.crosthwaite@xilinx.com: > From: Peter Crosthwaite >=20 > Use standard QOM cast macro. Remove usage of DO_UPCAST and > direct -> style upcasting. >=20 > Signed-off-by: Peter Crosthwaite > --- >=20 > hw/ide/piix.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/hw/ide/piix.c b/hw/ide/piix.c > index bf2856f..d0fdea3 100644 > --- a/hw/ide/piix.c > +++ b/hw/ide/piix.c > @@ -135,7 +135,7 @@ static void pci_piix_init_ports(PCIIDEState *d) { > int i; > =20 > for (i =3D 0; i < 2; i++) { > - ide_bus_new(&d->bus[i], &d->dev.qdev, i, 2); > + ide_bus_new(&d->bus[i], DEVICE(d), i, 2); > ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, > port_info[i].iobase2); > ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq)); > @@ -159,7 +159,7 @@ static int pci_piix_ide_initfn(PCIDevice *dev) > bmdma_setup_bar(d); > pci_register_bar(&d->dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_= bar); > =20 > - vmstate_register(&d->dev.qdev, 0, &vmstate_ide_pci, d); > + vmstate_register(DEVICE(dev), 0, &vmstate_ide_pci, d); > =20 > pci_piix_init_ports(d); > =20 > @@ -173,7 +173,7 @@ static int pci_piix3_xen_ide_unplug(DeviceState *de= v) > DriveInfo *di; > int i =3D 0; > =20 > - pci_dev =3D DO_UPCAST(PCIDevice, qdev, dev); > + pci_dev =3D PCI_DEVICE(dev); > pci_ide =3D DO_UPCAST(PCIIDEState, dev, pci_dev); This misses the actual type. Any reason for that? Andreas > =20 > for (; i < 3; i++) { > @@ -188,7 +188,7 @@ static int pci_piix3_xen_ide_unplug(DeviceState *de= v) > drive_put_ref(di); > } > } > - qdev_reset_all(&(pci_ide->dev.qdev)); > + qdev_reset_all(DEVICE(dev)); > return 0; > } > =20 >=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