OSDN Git Service

KVM: SVM: remove redundant ret variable
authorzhang songyi <zhang.songyi@zte.com.cn>
Mon, 28 Nov 2022 12:03:38 +0000 (20:03 +0800)
committerSean Christopherson <seanjc@google.com>
Tue, 24 Jan 2023 18:06:47 +0000 (10:06 -0800)
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>
arch/x86/kvm/svm/svm.c

index d13cf53..f5fd44f 100644 (file)
@@ -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) ||
-             (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)