]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: cleanup kvm_irq_delivery_to_apic_fast
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 13 Apr 2015 13:40:02 +0000 (15:40 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Apr 2015 16:09:51 +0000 (18:09 +0200)
commitff9cd93ff0d08da2d3a50264a1c2a445b2264456
tree455772e455f999852524239950529c92325d85d7
parent97128d9068d1e204d406cfdb7ea50321a763d394
KVM: x86: cleanup kvm_irq_delivery_to_apic_fast

Sparse is reporting a "we previously assumed 'src' could be null" error.
This is true as far as the static analyzer can see, but in practice only
IPIs can set shorthand to self and they also set 'src', so it's ok.
Still, move the initialization of x2apic_ipi (and thus the NULL check for
src right before the first use.

While at it, initializing ret to "false" is somewhat confusing because of
the almost immediate assigned of "true" to the same variable.  Thus,
initialize it to "true" and modify it in the only path that used to use
the value from "bool ret = false".  There is no change in generated code
from this change.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c