Skip to contentSkip to conversation

arch/x86/kvm: beautify source code for __u32 irq which is never < 0

PATCH Applied Chen Gang 2 participants 3 messages Feb 27, 2013 – Mar 5, 2013

Subsystems (3)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch/x86/kvm: beautify source code for __u32 irq which is never < 0

irp->irq is __u32 which is never < 0.

---
 arch/x86/kvm/x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +1 -1
index f71500a..811c5c9 100644
@@ -2700,7 +2700,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
 static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
 				    struct kvm_interrupt *irq)
 {
-	if (irq->irq < 0 || irq->irq >= KVM_NR_INTERRUPTS)
+	if (irq->irq >= KVM_NR_INTERRUPTS)
 		return -EINVAL;
 	if (irqchip_in_kernel(vcpu->kvm))
 		return -ENXIO;
Signature · 1 line
1.7.7.6
Applied
#1 lore raw
Quoted 4 lines · Chen Gang

irp->irq is __u32 which is never < 0.

Applied, thanks.

Quoted 19 lines
---
 arch/x86/kvm/x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +1 -1
index f71500a..811c5c9 100644
@@ -2700,7 +2700,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
 static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
 				    struct kvm_interrupt *irq)
 {
-	if (irq->irq < 0 || irq->irq >= KVM_NR_INTERRUPTS)
+	if (irq->irq >= KVM_NR_INTERRUPTS)
 		return -EINVAL;
 	if (irqchip_in_kernel(vcpu->kvm))
 		return -ENXIO;
Signature · 1 line
1.7.7.6

--
Gleb.

author
#2 lore raw
Quoted 7 lines · Gleb Natapov
Quoted 4 lines · Chen Gang
Quoted 4 lines

irp->irq is __u32 which is never < 0.

Applied, thanks.

thank you, too.

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation