CC: [email protected]
CC: [email protected]
CC: Robert Hu <[email protected]>
CC: Farrah Chen <[email protected]>
CC: Danmei Wei <[email protected]>
TO: Peter Xu <[email protected]>
CC: Paolo Bonzini <[email protected]>
CC: Lei Cao <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

virt/kvm/kvm_main.c:3060:29-35: WARNING: Consider using vma_pages helper on vma


 Use vma_pages function on vma object instead of explicit computation.

Generated by: scripts/coccinelle/api/vma_pages.cocci

Fixes: fb04a1eddb1a ("KVM: X86: Implement ring-based dirty memory tracking")
CC: Peter Xu <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head:   0a59d24b139a98ad0a2d778205fca6619014633f
commit: fb04a1eddb1a65b6588a021bdc132270d5ae48bb [24/39] KVM: X86: Implement 
ring-based dirty memory tracking
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago

Please take the patch only if it's a positive warning. Thanks!

 kvm_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -3057,7 +3057,7 @@ static const struct vm_operations_struct
 static int kvm_vcpu_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct kvm_vcpu *vcpu = file->private_data;
-       unsigned long pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+       unsigned long pages = vma_pages(vma);
 
        if ((kvm_page_in_dirty_ring(vcpu->kvm, vma->vm_pgoff) ||
             kvm_page_in_dirty_ring(vcpu->kvm, vma->vm_pgoff + pages - 1)) &&
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to