lkml.org 
[lkml]   [2021]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] KVM/X86: Remove unneeded variable
Date
Quanfa Fu <quanfafu@gmail.com> writes:

> Remove unneeded variable used to store return value.
>
> No functional change intended.
>
> Signed-off-by: Quanfa Fu <quanfafu@gmail.com>
> ---
> arch/x86/kvm/mmu/mmu.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index e2e1d012df22..7603db81b902 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -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 >> PAGE_SHIFT);

While on it, you could've switched to using gpa_to_gfn() here.

> }
>
> static void kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>

--
Vitaly

\
 
 \ /
  Last update: 2021-12-20 10:28    [W:0.026 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site