Skip to contentSkip to conversation

KVM: SVM: remove redundant ret variable

PATCH Applied [email protected] 2 participants 2 messages Nov 28, 2022 – Jan 19, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: SVM: remove redundant ret variable

From: zhang songyi <[email protected]>

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

---
 arch/x86/kvm/svm/svm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/x86/kvm/svm/svm.c +2 -5
index ce362e88a567..416812f971f2 100644
@@ -3572,7 +3572,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;
@@ -3580,10 +3579,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)

--
2.15.2