From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkwFU-0000yZ-Pw for qemu-devel@nongnu.org; Fri, 07 Jun 2013 08:58:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkwFQ-000862-JO for qemu-devel@nongnu.org; Fri, 07 Jun 2013 08:58:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53808 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkwFQ-000859-A5 for qemu-devel@nongnu.org; Fri, 07 Jun 2013 08:58:28 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 7 Jun 2013 14:58:20 +0200 Message-Id: <1370609900-21998-13-git-send-email-afaerber@suse.de> In-Reply-To: <1370609900-21998-1-git-send-email-afaerber@suse.de> References: <1370609900-21998-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 v2 12/12] qdev: Drop FROM_QBUS() macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws, "Michael S. Tsirkin" Use QOM cast macros I2C_BUS(), SSI_BUS(), PCI_BUS() instead. Signed-off-by: Andreas F=C3=A4rber --- hw/i2c/core.c | 4 ++-- hw/pci/pci.c | 2 +- hw/ssi/ssi.c | 2 +- include/hw/qdev-core.h | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/i2c/core.c b/hw/i2c/core.c index 0c4fc1d..22ef3b9 100644 --- a/hw/i2c/core.c +++ b/hw/i2c/core.c @@ -66,7 +66,7 @@ i2c_bus *i2c_init_bus(DeviceState *parent, const char *= name) { i2c_bus *bus; =20 - bus =3D FROM_QBUS(i2c_bus, qbus_create(TYPE_I2C_BUS, parent, name)); + bus =3D I2C_BUS(qbus_create(TYPE_I2C_BUS, parent, name)); vmstate_register(NULL, -1, &vmstate_i2c_bus, bus); return bus; } @@ -183,7 +183,7 @@ static int i2c_slave_post_load(void *opaque, int vers= ion_id) { I2CSlave *dev =3D opaque; i2c_bus *bus; - bus =3D FROM_QBUS(i2c_bus, qdev_get_parent_bus(&dev->qdev)); + bus =3D I2C_BUS(qdev_get_parent_bus(DEVICE(dev))); if (bus->saved_address =3D=3D dev->address) { bus->current_dev =3D dev; } diff --git a/hw/pci/pci.c b/hw/pci/pci.c index bb3879b..a3eb19e 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1700,7 +1700,7 @@ static int pci_qdev_init(DeviceState *qdev) pci_dev->cap_present |=3D QEMU_PCI_CAP_EXPRESS; } =20 - bus =3D FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev)); + bus =3D PCI_BUS(qdev_get_parent_bus(qdev)); pci_dev =3D do_pci_register_device(pci_dev, bus, object_get_typename(OBJECT(qdev)), pci_dev->devfn); diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c index 1264d9d..2c25260 100644 --- a/hw/ssi/ssi.c +++ b/hw/ssi/ssi.c @@ -103,7 +103,7 @@ SSIBus *ssi_create_bus(DeviceState *parent, const cha= r *name) { BusState *bus; bus =3D qbus_create(TYPE_SSI_BUS, parent, name); - return FROM_QBUS(SSIBus, bus); + return SSI_BUS(bus); } =20 uint32_t ssi_transfer(SSIBus *bus, uint32_t val) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index cf83d54..7fbffcb 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -261,8 +261,6 @@ void qbus_reset_all_fn(void *opaque); =20 void qbus_free(BusState *bus); =20 -#define FROM_QBUS(type, dev) DO_UPCAST(type, qbus, dev) - /* This should go away once we get rid of the NULL bus hack */ BusState *sysbus_get_default(void); =20 --=20 1.8.1.4