diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-09-05 13:00:52 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-06 11:37:44 -0400 |
commit | a50abc3b2b469ee80bc0f9ef5b6d457ef72659a9 (patch) | |
tree | b091f3302cd2bfd6452630655029f39b4d1ce6b1 /arch/x86 | |
parent | b3356bf0dbb34980620f2f7def7d1b9a0d325225 (diff) |
KVM: use symbolic constant for nr interrupts
interrupt_bitmap is KVM_NR_INTERRUPTS bits in size,
so just use that instead of hard-coded constants
and math.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index f91e2c9d7cb1..c4d451ed1573 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2366,7 +2366,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu, | |||
2366 | static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, | 2366 | static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, |
2367 | struct kvm_interrupt *irq) | 2367 | struct kvm_interrupt *irq) |
2368 | { | 2368 | { |
2369 | if (irq->irq < 0 || irq->irq >= 256) | 2369 | if (irq->irq < 0 || irq->irq >= KVM_NR_INTERRUPTS) |
2370 | return -EINVAL; | 2370 | return -EINVAL; |
2371 | if (irqchip_in_kernel(vcpu->kvm)) | 2371 | if (irqchip_in_kernel(vcpu->kvm)) |
2372 | return -ENXIO; | 2372 | return -ENXIO; |
@@ -5793,7 +5793,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
5793 | if (mmu_reset_needed) | 5793 | if (mmu_reset_needed) |
5794 | kvm_mmu_reset_context(vcpu); | 5794 | kvm_mmu_reset_context(vcpu); |
5795 | 5795 | ||
5796 | max_bits = (sizeof sregs->interrupt_bitmap) << 3; | 5796 | max_bits = KVM_NR_INTERRUPTS; |
5797 | pending_vec = find_first_bit( | 5797 | pending_vec = find_first_bit( |
5798 | (const unsigned long *)sregs->interrupt_bitmap, max_bits); | 5798 | (const unsigned long *)sregs->interrupt_bitmap, max_bits); |
5799 | if (pending_vec < max_bits) { | 5799 | if (pending_vec < max_bits) { |