summaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorLi kunyu <kunyu@nfschina.com>2022-08-19 10:28:04 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2022-08-19 04:05:43 -0400
commit2824913976a851f049bc8ab929b5c8d3b6ee269b (patch)
tree1aed4e4e374898f73e523ebb9beab689e88bd67f /virt/kvm/kvm_main.c
parent3d9606b0e0f3aed4dfb61d0853ebf432fead7bba (diff)
downloadlinux-2824913976a851f049bc8ab929b5c8d3b6ee269b.tar.gz
linux-2824913976a851f049bc8ab929b5c8d3b6ee269b.tar.bz2
linux-2824913976a851f049bc8ab929b5c8d3b6ee269b.zip
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/kvm/kvm_main.c')
-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();