[PATCH linux-next] mm:use vma_pages() for vma objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chen Haonan <chen.haonan2@xxxxxxxxxx>

vma_pages() is more readable and also better at avoiding error codes, 
so use vma_pages() instead of direct operations on vma

Signed-off-by: Chen Haonan <chen.haonan2@xxxxxxxxxx>
---
 mm/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/internal.h b/mm/internal.h
index 8450562744cf..222e63b2dea4 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -616,7 +616,7 @@ folio_within_range(struct folio *folio, struct vm_area_struct *vma,
                unsigned long start, unsigned long end)
 {
        pgoff_t pgoff, addr;
-       unsigned long vma_pglen = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+       unsigned long vma_pglen = vma_pages(vma);
 
        VM_WARN_ON_FOLIO(folio_test_ksm(folio), folio);
        if (start > end)
-- 
2.25.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux