* [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block
@ 2022-03-01 12:02 Like Xu
2022-03-01 16:01 ` Sean Christopherson
2022-03-15 21:38 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Like Xu @ 2022-03-01 12:02 UTC (permalink / raw)
To: Paolo Bonzini
Cc: kvm, Sean Christopherson, Wanpeng Li, Jim Mattson,
Vitaly Kuznetsov, Joerg Roedel, linux-kernel
From: Like Xu <likexu@tencent.com>
The [clang-analyzer-deadcode.DeadStores] helper reports
that the value stored to 'irq' is never read.
Signed-off-by: Like Xu <likexu@tencent.com>
---
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(-)
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index be99dc86293d..e1bb6218bb96 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -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 {
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block
2022-03-01 12:02 [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block Like Xu
@ 2022-03-01 16:01 ` Sean Christopherson
2022-03-15 21:38 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2022-03-01 16:01 UTC (permalink / raw)
To: Like Xu
Cc: Paolo Bonzini, kvm, Wanpeng Li, Jim Mattson, Vitaly Kuznetsov,
Joerg Roedel, linux-kernel
On Tue, Mar 01, 2022, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
>
> The [clang-analyzer-deadcode.DeadStores] helper reports
> that the value stored to 'irq' is never read.
>
> Signed-off-by: Like Xu <likexu@tencent.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
> ---
> 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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block
2022-03-01 12:02 [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block Like Xu
2022-03-01 16:01 ` Sean Christopherson
@ 2022-03-15 21:38 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-03-15 21:38 UTC (permalink / raw)
To: Like Xu
Cc: kvm, Sean Christopherson, Wanpeng Li, Jim Mattson,
Vitaly Kuznetsov, Joerg Roedel, linux-kernel
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-15 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 12:02 [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block Like Xu
2022-03-01 16:01 ` Sean Christopherson
2022-03-15 21:38 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.