Skip to content

Commit

Permalink
KVM: SVM: remove redundant ret variable
Browse files Browse the repository at this point in the history
Return value from svm_nmi_blocked() directly instead of taking
this in another redundant variable.

Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
Link: https://lore.kernel.org/r/202211282003389362484@zte.com.cn
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
zhang songyi authored and sean-jc committed Jan 19, 2023
1 parent de60733 commit 7cf4319
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/x86/kvm/svm/svm.c
Expand Up @@ -3583,18 +3583,15 @@ bool svm_nmi_blocked(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
struct vmcb *vmcb = svm->vmcb;
bool ret;

if (!gif_set(svm))
return true;

if (is_guest_mode(vcpu) && nested_exit_on_nmi(svm))
return false;

ret = (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) ||
(vcpu->arch.hflags & HF_NMI_MASK);

return ret;
return (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) ||
(vcpu->arch.hflags & HF_NMI_MASK);
}

static int svm_nmi_allowed(struct kvm_vcpu *vcpu, bool for_injection)
Expand Down

0 comments on commit 7cf4319

Please sign in to comment.