KVM: x86/i8259: Remove a dead store of irq in a conditional block
PATCH 1/1 KVM: x86/i8259: Remove a dead store of irq in a conditional block
From: Like Xu <[email protected]>
The [clang-analyzer-deadcode.DeadStores] helper reports that the value stored to 'irq' is never read.
---
Note: not sure if "irq2 + 8" should be needed for "s->pics[0].irq_base + irq"
arch/x86/kvm/i8259.c | 1 - 1 file changed, 1 deletion(-)
arch/x86/kvm/i8259.c +0 -1
@@ -252,7 +252,6 @@ int kvm_pic_read_irq(struct kvm *kvm)*/ irq2 =7 ; intno = s->pics[1 ].irq_base + irq2; - irq = irq2 +8 ; }else intno = s->pics[0 ].irq_base + irq; }else {
Signature · 1 line
2.35.1
Quoted 6 lines · Like Xu
From: Like Xu <[email protected]>
The [clang-analyzer-deadcode.DeadStores] helper reports that the value stored to 'irq' is never read.
Signed-off-by Like Xu <[email protected]>
Quoted 2 lines
---
Note: not sure if "irq2 + 8" should be needed for "s->pics[0].irq_base + irq"
Nope, IRQ 2 is used to cascade PIC controllers, and the two controllers have separate vector offsets/bases. The code was there in the original commit, 85f455f7ddbe ("KVM:
Add support for in-kernel PIC emulation"), best guess is that it was leftover from development, e.g. maybe a flawed assumption the the second PIC's vector was simply +8?
Queued, thanks.
Paolo