Skip to contentSkip to conversation

mm:use vma_pages() for vma objects

PATCH Applied [email protected] 1 participant 1 message Dec 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm:use vma_pages() for vma objects

From: Chen Haonan <[email protected]>

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

---
 mm/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/internal.h +1 -1
index 8450562744cf..222e63b2dea4 100644
@@ -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)
Signature · 1 line
2.25.1