Re: [PATCH] KVM: x86/i8259: Remove a dead store of irq in a conditional block
From: Sean Christopherson
Date: Tue Mar 01 2022 - 11:01:25 EST
On Tue, Mar 01, 2022, Like Xu wrote:
> From: Like Xu <likexu@xxxxxxxxxxx>
>
> The [clang-analyzer-deadcode.DeadStores] helper reports
> that the value stored to 'irq' is never read.
>
> Signed-off-by: Like Xu <likexu@xxxxxxxxxxx>
Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> 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?