aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/kvmvapic.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2013-04-05 16:36:59 +0200
committerAndreas Färber <afaerber@suse.de>2013-04-16 01:19:46 +0200
commitf1fc3e66581f638ba72d93c1a4912cfa573dd187 (patch)
tree271eca1c7f0dcab9329a1f5c8799245f85a42fa6 /hw/i386/kvmvapic.c
parentd3c64d6a1874f94246af91963927fb4d924332f1 (diff)
kvmvapic: Replace FROM_SYSBUS() with QOM type cast
... and define type name and type cast macro for kvmvapic according to accepted convention. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/i386/kvmvapic.c')
-rw-r--r--hw/i386/kvmvapic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
index ed9b448d07..3a10c0710c 100644
--- a/hw/i386/kvmvapic.c
+++ b/hw/i386/kvmvapic.c
@@ -60,6 +60,9 @@ typedef struct VAPICROMState {
bool rom_mapped_writable;
} VAPICROMState;
+#define TYPE_VAPIC "kvmvapic"
+#define VAPIC(obj) OBJECT_CHECK(VAPICROMState, (obj), TYPE_VAPIC)
+
#define TPR_INSTR_ABS_MODRM 0x1
#define TPR_INSTR_MATCH_MODRM_REG 0x2
@@ -690,7 +693,7 @@ static const MemoryRegionOps vapic_ops = {
static int vapic_init(SysBusDevice *dev)
{
- VAPICROMState *s = FROM_SYSBUS(VAPICROMState, dev);
+ VAPICROMState *s = VAPIC(dev);
memory_region_init_io(&s->io, &vapic_ops, s, "kvmvapic", 2);
sysbus_add_io(dev, VAPIC_IO_PORT, &s->io);
@@ -806,7 +809,7 @@ static void vapic_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo vapic_type = {
- .name = "kvmvapic",
+ .name = TYPE_VAPIC,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(VAPICROMState),
.class_init = vapic_class_init,