Commit 76954056 authored by Paolo Bonzini's avatar Paolo Bonzini

KVM: device assignment: remove pointless #ifdefs

The symbols are always defined.
Reviewed-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent b97e6de9
...@@ -131,7 +131,6 @@ static irqreturn_t kvm_assigned_dev_thread_intx(int irq, void *dev_id) ...@@ -131,7 +131,6 @@ static irqreturn_t kvm_assigned_dev_thread_intx(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#ifdef __KVM_HAVE_MSI
static irqreturn_t kvm_assigned_dev_msi(int irq, void *dev_id) static irqreturn_t kvm_assigned_dev_msi(int irq, void *dev_id)
{ {
struct kvm_assigned_dev_kernel *assigned_dev = 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) ...@@ -150,9 +149,7 @@ static irqreturn_t kvm_assigned_dev_thread_msi(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#endif
#ifdef __KVM_HAVE_MSIX
static irqreturn_t kvm_assigned_dev_msix(int irq, void *dev_id) static irqreturn_t kvm_assigned_dev_msix(int irq, void *dev_id)
{ {
struct kvm_assigned_dev_kernel *assigned_dev = 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) ...@@ -183,7 +180,6 @@ static irqreturn_t kvm_assigned_dev_thread_msix(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#endif
/* Ack the irq line for an assigned device */ /* Ack the irq line for an assigned device */
static void kvm_assigned_dev_ack_irq(struct kvm_irq_ack_notifier *kian) 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, ...@@ -386,7 +382,6 @@ static int assigned_device_enable_host_intx(struct kvm *kvm,
return 0; return 0;
} }
#ifdef __KVM_HAVE_MSI
static int assigned_device_enable_host_msi(struct kvm *kvm, static int assigned_device_enable_host_msi(struct kvm *kvm,
struct kvm_assigned_dev_kernel *dev) struct kvm_assigned_dev_kernel *dev)
{ {
...@@ -408,9 +403,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm, ...@@ -408,9 +403,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,
return 0; return 0;
} }
#endif
#ifdef __KVM_HAVE_MSIX
static int assigned_device_enable_host_msix(struct kvm *kvm, static int assigned_device_enable_host_msix(struct kvm *kvm,
struct kvm_assigned_dev_kernel *dev) struct kvm_assigned_dev_kernel *dev)
{ {
...@@ -443,8 +436,6 @@ static int assigned_device_enable_host_msix(struct kvm *kvm, ...@@ -443,8 +436,6 @@ static int assigned_device_enable_host_msix(struct kvm *kvm,
return r; return r;
} }
#endif
static int assigned_device_enable_guest_intx(struct kvm *kvm, static int assigned_device_enable_guest_intx(struct kvm *kvm,
struct kvm_assigned_dev_kernel *dev, struct kvm_assigned_dev_kernel *dev,
struct kvm_assigned_irq *irq) struct kvm_assigned_irq *irq)
...@@ -454,7 +445,6 @@ static int assigned_device_enable_guest_intx(struct kvm *kvm, ...@@ -454,7 +445,6 @@ static int assigned_device_enable_guest_intx(struct kvm *kvm,
return 0; return 0;
} }
#ifdef __KVM_HAVE_MSI
static int assigned_device_enable_guest_msi(struct kvm *kvm, static int assigned_device_enable_guest_msi(struct kvm *kvm,
struct kvm_assigned_dev_kernel *dev, struct kvm_assigned_dev_kernel *dev,
struct kvm_assigned_irq *irq) struct kvm_assigned_irq *irq)
...@@ -463,9 +453,7 @@ static int assigned_device_enable_guest_msi(struct kvm *kvm, ...@@ -463,9 +453,7 @@ static int assigned_device_enable_guest_msi(struct kvm *kvm,
dev->ack_notifier.gsi = -1; dev->ack_notifier.gsi = -1;
return 0; return 0;
} }
#endif
#ifdef __KVM_HAVE_MSIX
static int assigned_device_enable_guest_msix(struct kvm *kvm, static int assigned_device_enable_guest_msix(struct kvm *kvm,
struct kvm_assigned_dev_kernel *dev, struct kvm_assigned_dev_kernel *dev,
struct kvm_assigned_irq *irq) struct kvm_assigned_irq *irq)
...@@ -474,7 +462,6 @@ static int assigned_device_enable_guest_msix(struct kvm *kvm, ...@@ -474,7 +462,6 @@ static int assigned_device_enable_guest_msix(struct kvm *kvm,
dev->ack_notifier.gsi = -1; dev->ack_notifier.gsi = -1;
return 0; return 0;
} }
#endif
static int assign_host_irq(struct kvm *kvm, static int assign_host_irq(struct kvm *kvm,
struct kvm_assigned_dev_kernel *dev, struct kvm_assigned_dev_kernel *dev,
...@@ -492,16 +479,12 @@ static int assign_host_irq(struct kvm *kvm, ...@@ -492,16 +479,12 @@ static int assign_host_irq(struct kvm *kvm,
case KVM_DEV_IRQ_HOST_INTX: case KVM_DEV_IRQ_HOST_INTX:
r = assigned_device_enable_host_intx(kvm, dev); r = assigned_device_enable_host_intx(kvm, dev);
break; break;
#ifdef __KVM_HAVE_MSI
case KVM_DEV_IRQ_HOST_MSI: case KVM_DEV_IRQ_HOST_MSI:
r = assigned_device_enable_host_msi(kvm, dev); r = assigned_device_enable_host_msi(kvm, dev);
break; break;
#endif
#ifdef __KVM_HAVE_MSIX
case KVM_DEV_IRQ_HOST_MSIX: case KVM_DEV_IRQ_HOST_MSIX:
r = assigned_device_enable_host_msix(kvm, dev); r = assigned_device_enable_host_msix(kvm, dev);
break; break;
#endif
default: default:
r = -EINVAL; r = -EINVAL;
} }
...@@ -534,16 +517,12 @@ static int assign_guest_irq(struct kvm *kvm, ...@@ -534,16 +517,12 @@ static int assign_guest_irq(struct kvm *kvm,
case KVM_DEV_IRQ_GUEST_INTX: case KVM_DEV_IRQ_GUEST_INTX:
r = assigned_device_enable_guest_intx(kvm, dev, irq); r = assigned_device_enable_guest_intx(kvm, dev, irq);
break; break;
#ifdef __KVM_HAVE_MSI
case KVM_DEV_IRQ_GUEST_MSI: case KVM_DEV_IRQ_GUEST_MSI:
r = assigned_device_enable_guest_msi(kvm, dev, irq); r = assigned_device_enable_guest_msi(kvm, dev, irq);
break; break;
#endif
#ifdef __KVM_HAVE_MSIX
case KVM_DEV_IRQ_GUEST_MSIX: case KVM_DEV_IRQ_GUEST_MSIX:
r = assigned_device_enable_guest_msix(kvm, dev, irq); r = assigned_device_enable_guest_msix(kvm, dev, irq);
break; break;
#endif
default: default:
r = -EINVAL; r = -EINVAL;
} }
...@@ -826,7 +805,6 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm, ...@@ -826,7 +805,6 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm,
} }
#ifdef __KVM_HAVE_MSIX
static int kvm_vm_ioctl_set_msix_nr(struct kvm *kvm, static int kvm_vm_ioctl_set_msix_nr(struct kvm *kvm,
struct kvm_assigned_msix_nr *entry_nr) struct kvm_assigned_msix_nr *entry_nr)
{ {
...@@ -906,7 +884,6 @@ static int kvm_vm_ioctl_set_msix_entry(struct kvm *kvm, ...@@ -906,7 +884,6 @@ static int kvm_vm_ioctl_set_msix_entry(struct kvm *kvm,
return r; return r;
} }
#endif
static int kvm_vm_ioctl_set_pci_irq_mask(struct kvm *kvm, static int kvm_vm_ioctl_set_pci_irq_mask(struct kvm *kvm,
struct kvm_assigned_pci_dev *assigned_dev) struct kvm_assigned_pci_dev *assigned_dev)
...@@ -1012,7 +989,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, ...@@ -1012,7 +989,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
goto out; goto out;
break; break;
} }
#ifdef __KVM_HAVE_MSIX
case KVM_ASSIGN_SET_MSIX_NR: { case KVM_ASSIGN_SET_MSIX_NR: {
struct kvm_assigned_msix_nr entry_nr; struct kvm_assigned_msix_nr entry_nr;
r = -EFAULT; r = -EFAULT;
...@@ -1033,7 +1009,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, ...@@ -1033,7 +1009,6 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
goto out; goto out;
break; break;
} }
#endif
case KVM_ASSIGN_SET_INTX_MASK: { case KVM_ASSIGN_SET_INTX_MASK: {
struct kvm_assigned_pci_dev assigned_dev; struct kvm_assigned_pci_dev assigned_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment