@@ -466,9 +466,13 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
kvmppc_remove_vcpu_debugfs(vcpu);
switch (vcpu->arch.irq_type) {
+#ifdef CONFIG_KVM_MPIC
case KVMPPC_IRQ_MPIC:
kvmppc_mpic_put(vcpu->arch.mpic);
break;
+#endif
+ default:
+ break;
}
kvmppc_core_vcpu_free(vcpu);
@@ -2161,13 +2161,11 @@ out:
static int kvm_ioctl_create_device(struct kvm *kvm,
struct kvm_create_device *cd)
{
- bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
-
switch (cd->type) {
#ifdef CONFIG_KVM_MPIC
case KVM_DEV_TYPE_FSL_MPIC_20:
case KVM_DEV_TYPE_FSL_MPIC_42: {
- if (test)
+ if (cd->flags & KVM_CREATE_DEVICE_TEST)
return 0;
return kvm_create_mpic(kvm, cd->type);