Skip to contentSkip to conversation

KVM/X86: Remove unneeded variable

PATCH New Quanfa Fu 1 participant 1 message Dec 20, 2021

Subsystems (3)
lore
Share & tools
lore

Quanfa Fu

author
#0 lore raw

PATCH v2 1/1 KVM/X86: Remove unneeded variable

Remove unneeded variable used to store return value. Replace gpa >> PAGE_SHIFT with gpa_to_gfn(gpa)

No functional change intended.

---
 arch/x86/kvm/mmu/mmu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/x86/kvm/mmu/mmu.c +1 -4
index e2e1d012df22..61e35170ee2e 100644
@@ -2553,16 +2553,13 @@ int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn)
 static int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
 {
 	gpa_t gpa;
-	int r;
 
 	if (vcpu->arch.mmu->direct_map)
 		return 0;
 
 	gpa = kvm_mmu_gva_to_gpa_read(vcpu, gva, NULL);
 
-	r = kvm_mmu_unprotect_page(vcpu->kvm, gpa >> PAGE_SHIFT);
-
-	return r;
+	return kvm_mmu_unprotect_page(vcpu->kvm, gpa_to_gfn(gpa));
 }
 
 static void kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
Signature · 1 line
2.25.1