From patchwork Wed May 22 05:33:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 245514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 85C572C00A1 for ; Wed, 22 May 2013 15:37:12 +1000 (EST) Received: from localhost ([::1]:38936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1ja-00063a-P1 for incoming@patchwork.ozlabs.org; Wed, 22 May 2013 01:37:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1gx-0002Ri-RU for qemu-devel@nongnu.org; Wed, 22 May 2013 01:34:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf1gp-0008Ux-N0 for qemu-devel@nongnu.org; Wed, 22 May 2013 01:34:27 -0400 Received: from [222.73.24.84] (port=12267 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf1gp-0008RJ-B6 for qemu-devel@nongnu.org; Wed, 22 May 2013 01:34:19 -0400 X-IronPort-AV: E=Sophos;i="4.87,719,1363104000"; d="scan'208";a="7330824" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 22 May 2013 13:31:12 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r4M5Y01m022012; Wed, 22 May 2013 13:34:00 +0800 Received: from G08FNSTD100614.fnst.cn.fujitsu.com ([10.167.233.156]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013052213324214-1422181 ; Wed, 22 May 2013 13:32:42 +0800 From: Hu Tao To: qemu-devel@nongnu.org Date: Wed, 22 May 2013 13:33:07 +0800 Message-Id: <7430f571960515550f5929ce61586c11a7c9e4f3.1369193012.git.hutao@cn.fujitsu.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/22 13:32:42, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/22 13:32:43, Serialize complete at 2013/05/22 13:32:43 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Cc: Vasilis Liaskovitis , Jan Kiszka , Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Wanpeng Li Subject: [Qemu-devel] [RFC PATCH v1 03/20] i440fx: rename i440FX-pcihost to i440FX 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: Hu Tao --- hw/pci-host/piix.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index fc955bd..9c482ec 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_DEVICE "i440FX" +#define I440FX_DEVICE(obj) \ + OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_DEVICE) + typedef struct I440FXState { PCIHostState parent_obj; } I440FXState; @@ -197,7 +201,7 @@ static const VMStateDescription vmstate_i440fx_pmc = { } }; -static int i440fx_pcihost_initfn(SysBusDevice *dev) +static int i440fx_initfn(SysBusDevice *dev) { PCIHostState *s = PCI_HOST_BRIDGE(dev); @@ -245,7 +249,7 @@ static PCIBus *i440fx_common_init(const char *device_name, I440FXPMCState *f; unsigned i; - dev = qdev_create(NULL, "i440FX-pcihost"); + dev = qdev_create(NULL, TYPE_I440FX_DEVICE); s = PCI_HOST_BRIDGE(dev); b = pci_bus_new(dev, NULL, pci_address_space, address_space_io, 0, TYPE_PCI_BUS); @@ -627,21 +631,21 @@ static const TypeInfo i440fx_pmc_info = { .class_init = i440fx_pmc_class_init, }; -static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) +static void i440fx_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = i440fx_pcihost_initfn; + k->init = i440fx_initfn; dc->fw_name = "pci"; dc->no_user = 1; } -static const TypeInfo i440fx_pcihost_info = { - .name = "i440FX-pcihost", +static const TypeInfo i440fx_info = { + .name = TYPE_I440FX_DEVICE, .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(I440FXState), - .class_init = i440fx_pcihost_class_init, + .class_init = i440fx_class_init, }; static void i440fx_register_types(void) @@ -649,7 +653,7 @@ static void i440fx_register_types(void) type_register_static(&i440fx_pmc_info); type_register_static(&piix3_info); type_register_static(&piix3_xen_info); - type_register_static(&i440fx_pcihost_info); + type_register_static(&i440fx_info); } type_init(i440fx_register_types)