Skip to content

Commit

Permalink
mm: use vma_pages() for vma objects
Browse files Browse the repository at this point in the history
vma_pages() is more readable and also better at avoiding error codes, so
use vma_pages() instead of direct operations on vma

Link: https://lkml.kernel.org/r/tencent_151850CF327EB055BBC83298A929BD06CD0A@qq.com
Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Chen Haonan authored and Andrew Morton committed Dec 12, 2023
1 parent 4196810 commit dd05f5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd05f5e

Please sign in to comment.