lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211282003389362484@zte.com.cn>
Date:   Mon, 28 Nov 2022 20:03:38 +0800 (CST)
From:   <zhang.songyi@....com.cn>
To:     <seanjc@...gle.com>
Cc:     <pbonzini@...hat.com>, <tglx@...utronix.de>, <mingo@...hat.com>,
        <bp@...en8.de>, <dave.hansen@...ux.intel.com>, <x86@...nel.org>,
        <hpa@...or.com>, <kvm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH linux-next] KVM: SVM: remove redundant ret variable

From: zhang songyi <zhang.songyi@....com.cn>

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

Signed-off-by: zhang songyi <zhang.songyi@....com.cn>
---
 arch/x86/kvm/svm/svm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index ce362e88a567..416812f971f2 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ