summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorLi kunyu <kunyu@nfschina.com>2022-08-19 05:28:04 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-08-19 11:05:43 +0300
commit2824913976a851f049bc8ab929b5c8d3b6ee269b (patch)
tree1aed4e4e374898f73e523ebb9beab689e88bd67f /virt
parent3d9606b0e0f3aed4dfb61d0853ebf432fead7bba (diff)
downloadlinux-2824913976a851f049bc8ab929b5c8d3b6ee269b.tar.xz
KVM: Drop unnecessary initialization of "npages" in hva_to_pfn_slow()
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>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5142c054b03c..c916c4c8801c 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -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();