mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: Remove redundant ret = 0 in svm_set_nested_state
@ 2026-06-18  8:52 Qiang Ma
  2026-07-14 18:41 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Qiang Ma @ 2026-06-18  8:52 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, bp, dave.hansen, x86, hpa
  Cc: kvm, linux-kernel, Qiang Ma

In svm_set_nested_state(), the success path reaches out_free with
ret already set to 0 from nested_svm_load_cr3(). The explicit
'ret = 0' assignment before out_free is therefore redundant.
Remove it.

No functional change.

Signed-off-by: Qiang Ma <maqianga@uniontech.com>
---
 arch/x86/kvm/svm/nested.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index b340dc9991adb..b95e7283bc888 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -2019,7 +2019,6 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
 		kvm_make_request(KVM_REQ_APICV_UPDATE, vcpu);
 
 	kvm_make_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu);
-	ret = 0;
 out_free:
 	kfree(save);
 	kfree(ctl);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: SVM: Remove redundant ret = 0 in svm_set_nested_state
  2026-06-18  8:52 [PATCH] KVM: SVM: Remove redundant ret = 0 in svm_set_nested_state Qiang Ma
@ 2026-07-14 18:41 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2026-07-14 18:41 UTC (permalink / raw)
  To: Sean Christopherson, pbonzini, tglx, bp, dave.hansen, x86, hpa, Qiang Ma
  Cc: kvm, linux-kernel

On Thu, 18 Jun 2026 16:52:17 +0800, Qiang Ma wrote:
> In svm_set_nested_state(), the success path reaches out_free with
> ret already set to 0 from nested_svm_load_cr3(). The explicit
> 'ret = 0' assignment before out_free is therefore redundant.
> Remove it.
> 
> No functional change.
> 
> [...]

Applied to kvm-x86 svm, thanks!

[1/1] KVM: SVM: Remove redundant ret = 0 in svm_set_nested_state
      https://github.com/kvm-x86/linux/commit/bfafeb04a040

--
https://github.com/kvm-x86/linux/tree/next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-14 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18  8:52 [PATCH] KVM: SVM: Remove redundant ret = 0 in svm_set_nested_state Qiang Ma
2026-07-14 18:41 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®