KVM: Drop unnecessary initialization of "npages" in hva_to_pfn_slow()
authorLi kunyu <kunyu@nfschina.com>
Fri, 19 Aug 2022 02:28:04 +0000 (10:28 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Aug 2022 08:05:43 +0000 (04:05 -0400)
The variable is initialized but it is only used after its assignment.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Li kunyu <kunyu@nfschina.com>
Message-Id: <20220819022804.483914-1-kunyu@nfschina.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c

index 5142c054b03c796defc0c08f311a6c07d7640313..c916c4c8801c05454f51b993a54c7a2722bf4983 100644 (file)
@@ -2518,7 +2518,7 @@ static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault,
 {
        unsigned int flags = FOLL_HWPOISON;
        struct page *page;
-       int npages = 0;
+       int npages;
 
        might_sleep();