From patchwork Thu Mar 21 14:28:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 229717 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 E3B7C2C00BE for ; Fri, 22 Mar 2013 01:40:18 +1100 (EST) Received: from localhost ([::1]:55863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIgWQ-0005PG-AQ for incoming@patchwork.ozlabs.org; Thu, 21 Mar 2013 10:31:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIgVI-0004X5-M2 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 10:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIgUx-0004I8-7Y for qemu-devel@nongnu.org; Thu, 21 Mar 2013 10:29:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIgUw-0004Fj-W7 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 10:29:43 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2LETPFG025006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Mar 2013 10:29:25 -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-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2LESmH4008812; Thu, 21 Mar 2013 10:29:21 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Thu, 21 Mar 2013 15:28:39 +0100 Message-Id: <1363876125-8264-7-git-send-email-imammedo@redhat.com> In-Reply-To: <1363876125-8264-1-git-send-email-imammedo@redhat.com> References: <1363876125-8264-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, stefano.stabellini@eu.citrix.com, claudio.fontana@huawei.com, armbru@redhat.com, quintela@redhat.com, lcapitulino@redhat.com, blauwirbel@gmail.com, yang.z.zhang@intel.com, alex.williamson@redhat.com, aderumier@odiso.com, kraxel@redhat.com, anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de, rth@twiddle.net Subject: [Qemu-devel] [PATCH 06/12] target-i386: replace FROM_SYSBUS() with QOM type cast 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 ... and define type name and type cast macro for kvmvapic according to accepted convention. Signed-off-by: Igor Mammedov Reviewed-by: Paolo Bonzini --- hw/i386/kvmvapic.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index c151c95..21551a5 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -62,6 +62,9 @@ typedef struct VAPICROMState { bool rom_mapped_writable; } VAPICROMState; +#define TYPE_VAPIC_DEVICE "kvmvapic" +#define VAPIC_DEVICE(obj) OBJECT_CHECK(VAPICROMState, (obj), TYPE_VAPIC_DEVICE) + #define TPR_INSTR_ABS_MODRM 0x1 #define TPR_INSTR_MATCH_MODRM_REG 0x2 @@ -692,7 +695,7 @@ static const MemoryRegionOps vapic_ops = { static int vapic_init(SysBusDevice *dev) { - VAPICROMState *s = FROM_SYSBUS(VAPICROMState, dev); + VAPICROMState *s = VAPIC_DEVICE(dev); memory_region_init_io(&s->io, &vapic_ops, s, "kvmvapic", 2); sysbus_add_io(dev, VAPIC_IO_PORT, &s->io); @@ -808,7 +811,7 @@ static void vapic_class_init(ObjectClass *klass, void *data) } static const TypeInfo vapic_type = { - .name = "kvmvapic", + .name = TYPE_VAPIC_DEVICE, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(VAPICROMState), .class_init = vapic_class_init,