From patchwork Mon Jul 29 14:47:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 262805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B61A02C0108 for ; Tue, 30 Jul 2013 00:49:34 +1000 (EST) Received: from localhost ([::1]:40197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3olQ-0000Dp-JH for incoming@patchwork.ozlabs.org; Mon, 29 Jul 2013 10:49:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3oks-0008Rs-H7 for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:49:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3okn-0002Is-8p for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:48:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3okn-0002Io-0y for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:48:53 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6TEmpHI026907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Jul 2013 10:48:52 -0400 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6TEmevZ028836; Mon, 29 Jul 2013 10:48:49 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2013 16:47:52 +0200 Message-Id: <1375109277-25561-3-git-send-email-imammedo@redhat.com> In-Reply-To: <1375109277-25561-1-git-send-email-imammedo@redhat.com> References: <1375109277-25561-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: afaerber@suse.de, mst@redhat.com Subject: [Qemu-devel] [PATCH 2/7] pc: add I440FX QOM cast macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Igor Mammedov --- v2: * add _BRIDGE suffix to type and cast macros --- hw/pci-host/piix.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 3908860..39e9c55 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -38,6 +38,10 @@ * http://download.intel.com/design/chipsets/datashts/29054901.pdf */ +#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" +#define I440FX_PCI_HOST_BRIDGE(obj) \ + OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_PCI_HOST_BRIDGE) + typedef struct I440FXState { PCIHostState parent_obj; } I440FXState; @@ -257,7 +261,7 @@ static PCIBus *i440fx_common_init(const char *device_name, PCII440FXState *f; unsigned i; - dev = qdev_create(NULL, "i440FX-pcihost"); + dev = qdev_create(NULL, TYPE_I440FX_PCI_HOST_BRIDGE); s = PCI_HOST_BRIDGE(dev); b = pci_bus_new(dev, NULL, pci_address_space, address_space_io, 0, TYPE_PCI_BUS); @@ -661,7 +665,7 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) } static const TypeInfo i440fx_pcihost_info = { - .name = "i440FX-pcihost", + .name = TYPE_I440FX_PCI_HOST_BRIDGE, .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(I440FXState), .instance_init = i440fx_pcihost_initfn,