KVM: device assignment: remove pointless #ifdefs
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 28 Oct 2015 18:22:20 +0000 (19:22 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 4 Nov 2015 15:24:35 +0000 (16:24 +0100)
The symbols are always defined.

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/assigned-dev.c

index d090ecf088097f4f845fc20d7d1bdd0a5849e712..1c17ee807ef7b2fe8b4265ad283967ada64c466a 100644 (file)
@@ -131,7 +131,6 @@ static irqreturn_t kvm_assigned_dev_thread_intx(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-#ifdef __KVM_HAVE_MSI
 static irqreturn_t kvm_assigned_dev_msi(int irq, void *dev_id)
 {
        struct kvm_assigned_dev_kernel *assigned_dev = dev_id;
@@ -150,9 +149,7 @@ static irqreturn_t kvm_assigned_dev_thread_msi(int irq, void *dev_id)
 
        return IRQ_HANDLED;
 }
-#endif
 
-#ifdef __KVM_HAVE_MSIX
 static irqreturn_t kvm_assigned_dev_msix(int irq, void *dev_id)
 {
        struct kvm_assigned_dev_kernel *assigned_dev = dev_id;
@@ -183,7 +180,6 @@ static irqreturn_t kvm_assigned_dev_thread_msix(int irq, void *dev_id)
 
        return IRQ_HANDLED;
 }
-#endif
 
 /* Ack the irq line for an assigned device */
 static void kvm_assigned_dev_ack_irq(struct kvm_irq_ack_notifier *kian)
@@ -386,7 +382,6 @@ static int assigned_device_enable_host_intx(struct kvm *kvm,
        return 0;
 }
 
-#ifdef __KVM_HAVE_MSI
 static int assigned_device_enable_host_msi(struct kvm *kvm,
                                           struct kvm_assigned_dev_kernel *dev)
 {
@@ -408,9 +403,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,
 
        return 0;
 }
-#endif
 
-#ifdef __KVM_HAVE_MSIX
 static int assigned_device_enable_host_msix(struct kvm *kvm,
                                            struct kvm_assigned_dev_kernel *dev)
 {
@@ -443,8 +436,6 @@ err:
        return r;
 }
 
-#endif
-
 static int assigned_device_enable_guest_intx(struct kvm *kvm,
                                struct kvm_assigned_dev_kernel *dev,
                                struct kvm_assigned_irq *irq)
@@ -454,7 +445,6 @@ static int assigned_device_enable_guest_intx(struct kvm *kvm,
        return 0;
 }
 
-#ifdef __KVM_HAVE_MSI
 static int assigned_device_enable_guest_msi(struct kvm *kvm,
                        struct kvm_assigned_dev_kernel *dev,
                        struct kvm_assigned_irq *irq)
@@ -463,9 +453,7 @@ static int assigned_device_enable_guest_msi(struct kvm *kvm,
        dev->ack_notifier.gsi = -1;
        return 0;
 }
-#endif
 
-#ifdef __KVM_HAVE_MSIX
 static int assigned_device_enable_guest_msix(struct kvm *kvm,
                        struct kvm_assigned_dev_kernel *dev,
                        struct kvm_assigned_irq *irq)
@@ -474,7 +462,6 @@ static int assigned_device_enable_guest_msix(struct kvm *kvm,
        dev->ack_notifier.gsi = -1;
        return 0;
 }
-#endif
 
 static int assign_host_irq(struct kvm *kvm,
                           struct kvm_assigned_dev_kernel *dev,
@@ -492,16 +479,12 @@ static int assign_host_irq(struct kvm *kvm,
        case KVM_DEV_IRQ_HOST_INTX:
                r = assigned_device_enable_host_intx(kvm, dev);
                break;
-#ifdef __KVM_HAVE_MSI
        case KVM_DEV_IRQ_HOST_MSI:
                r = assigned_device_enable_host_msi(kvm, dev);
                break;
-#endif
-#ifdef __KVM_HAVE_MSIX
        case KVM_DEV_IRQ_HOST_MSIX:
                r = assigned_device_enable_host_msix(kvm, dev);
                break;
-#endif
        default:
                r = -EINVAL;
        }
@@ -534,16 +517,12 @@ static int assign_guest_irq(struct kvm *kvm,
        case KVM_DEV_IRQ_GUEST_INTX:
                r = assigned_device_enable_guest_intx(kvm, dev, irq);
                break;
-#ifdef __KVM_HAVE_MSI
        case KVM_DEV_IRQ_GUEST_MSI:
                r = assigned_device_enable_guest_msi(kvm, dev, irq);
                break;
-#endif
-#ifdef __KVM_HAVE_MSIX
        case KVM_DEV_IRQ_GUEST_MSIX:
                r = assigned_device_enable_guest_msix(kvm, dev, irq);
                break;
-#endif
        default:
                r = -EINVAL;
        }
@@ -826,7 +805,6 @@ out:
 }
 
 
-#ifdef __KVM_HAVE_MSIX
 static int kvm_vm_ioctl_set_msix_nr(struct kvm *kvm,
                                    struct kvm_assigned_msix_nr *entry_nr)
 {
@@ -906,7 +884,6 @@ msix_entry_out:
 
        return r;
 }
-#endif
 
 static int kvm_vm_ioctl_set_pci_irq_mask(struct kvm *kvm,
                struct kvm_assigned_pci_dev *assigned_dev)
@@ -1012,7 +989,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
                        goto out;
                break;
        }
-#ifdef __KVM_HAVE_MSIX
        case KVM_ASSIGN_SET_MSIX_NR: {
                struct kvm_assigned_msix_nr entry_nr;
                r = -EFAULT;
@@ -1033,7 +1009,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
                        goto out;
                break;
        }
-#endif
        case KVM_ASSIGN_SET_INTX_MASK: {
                struct kvm_assigned_pci_dev assigned_dev;