From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKnVD-000155-3y for qemu-devel@nongnu.org; Wed, 27 Mar 2013 06:22:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKnVB-0003N0-Sx for qemu-devel@nongnu.org; Wed, 27 Mar 2013 06:22:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKnVB-0003Mt-Ip for qemu-devel@nongnu.org; Wed, 27 Mar 2013 06:22:41 -0400 Message-ID: <5152C85C.6060200@redhat.com> Date: Wed, 27 Mar 2013 11:22:20 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363876125-8264-1-git-send-email-imammedo@redhat.com> <1363876125-8264-7-git-send-email-imammedo@redhat.com> In-Reply-To: <1363876125-8264-7-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/12] target-i386: replace FROM_SYSBUS() with QOM type cast List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov 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, qemu-devel@nongnu.org, quintela@redhat.com, armbru@redhat.com, blauwirbel@gmail.com, yang.z.zhang@intel.com, alex.williamson@redhat.com, aderumier@odiso.com, kraxel@redhat.com, anthony.perard@citrix.com, lcapitulino@redhat.com, afaerber@suse.de, rth@twiddle.net Il 21/03/2013 15:28, Igor Mammedov ha scritto: > ... and define type name and type cast macro for kvmvapic according > to accepted convention. > > Signed-off-by: Igor Mammedov > --- > 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, > Reviewed-by: Paolo Bonzini