From 100f738850639a108d6767316ce4dcc1d1ea4ae4 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Thu, 8 Jun 2017 15:42:50 +0200 Subject: xics: pass appropriate types to realize() handlers. It makes more sense to pass an IPCState * to handlers of ICPStateClass instead of a DeviceState *, if only to benefit from compile time type checking. The same goes with ICSStateClass. While here, we also change the declaration of ICPStateClass in xics.h for consistency. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/intc/xics_kvm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'hw/intc/xics_kvm.c') diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 45bf110b51..41c5b94395 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -328,10 +328,8 @@ static void ics_kvm_reset(void *dev) ics_set_kvm_state(ics, 1); } -static void ics_kvm_realize(DeviceState *dev, Error **errp) +static void ics_kvm_realize(ICSState *ics, Error **errp) { - ICSState *ics = ICS_SIMPLE(dev); - if (!ics->nr_irqs) { error_setg(errp, "Number of interrupts needs to be greater 0"); return; @@ -339,7 +337,7 @@ static void ics_kvm_realize(DeviceState *dev, Error **errp) ics->irqs = g_malloc0(ics->nr_irqs * sizeof(ICSIRQState)); ics->qirqs = qemu_allocate_irqs(ics_kvm_set_irq, ics, ics->nr_irqs); - qemu_register_reset(ics_kvm_reset, dev); + qemu_register_reset(ics_kvm_reset, ics); } static void ics_kvm_class_init(ObjectClass *klass, void *data) -- cgit v1.2.3