Commit 5f6015b2 authored by zhang songyi's avatar zhang songyi Committed by Sean Christopherson
Browse files

KVM: SVM: remove redundant ret variable



Return value from svm_nmi_blocked() directly instead of taking
this in another redundant variable.

Signed-off-by: default avatarzhang songyi <zhang.songyi@zte.com.cn>
Link: https://lore.kernel.org/r/202211282003389362484@zte.com.cn


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 7cb79f43
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -3583,7 +3583,6 @@ 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;
@@ -3591,10 +3590,8 @@ bool svm_nmi_blocked(struct kvm_vcpu *vcpu)
	if (is_guest_mode(vcpu) && nested_exit_on_nmi(svm))
		return false;

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

	return ret;
}

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