* [PATCH linux-next] KVM: SVM: remove redundant ret variable
@ 2022-11-28 12:03 zhang.songyi
2023-01-19 21:03 ` Sean Christopherson
0 siblings, 1 reply; 2+ messages in thread
From: zhang.songyi @ 2022-11-28 12:03 UTC (permalink / raw)
To: seanjc
Cc: pbonzini, tglx, mingo, bp, dave.hansen, x86, hpa, kvm, linux-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-next] KVM: SVM: remove redundant ret variable
2022-11-28 12:03 [PATCH linux-next] KVM: SVM: remove redundant ret variable zhang.songyi
@ 2023-01-19 21:03 ` Sean Christopherson
0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2023-01-19 21:03 UTC (permalink / raw)
To: Sean Christopherson, zhang.songyi
Cc: pbonzini, tglx, mingo, bp, dave.hansen, x86, hpa, kvm, linux-kernel
On Mon, 28 Nov 2022 20:03:38 +0800, zhang.songyi@zte.com.cn wrote:
> Return value from svm_nmi_blocked() directly instead of taking
> this in another redundant variable.
>
>
Applied to kvm-x86 svm, thanks!
[1/1] KVM: SVM: remove redundant ret variable
https://github.com/kvm-x86/linux/commit/7cf431985767
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-19 21:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 12:03 [PATCH linux-next] KVM: SVM: remove redundant ret variable zhang.songyi
2023-01-19 21:03 ` Sean Christopherson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.