The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: <zhang.songyi@zte.com.cn>
To: <seanjc@google.com>
Cc: <pbonzini@redhat.com>, <tglx@linutronix.de>, <mingo@redhat.com>,
	<bp@alien8.de>, <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	<hpa@zytor.com>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH linux-next] KVM: SVM: remove redundant ret variable
Date: Mon, 28 Nov 2022 20:03:38 +0800 (CST)	[thread overview]
Message-ID: <202211282003389362484@zte.com.cn> (raw)

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

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>
---
 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

             reply	other threads:[~2022-11-28 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 12:03 zhang.songyi [this message]
2023-01-19 21:03 ` [PATCH linux-next] KVM: SVM: remove redundant ret variable Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211282003389362484@zte.com.cn \
    --to=zhang.songyi@zte.com.cn \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox