diff options
author | Chen Haonan <chen.haonan2@zte.com.cn> | 2023-12-06 11:36:27 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-12 19:57:08 +0100 |
commit | dd05f5ec1e468b7dd723e1571dbd41d6f30a201d (patch) | |
tree | 9e9a279b04a3cb3c75217d7c22722118265f56dc /mm/internal.h | |
parent | mm: cma: remove unnecessary initialization of ret (diff) | |
download | linux-dd05f5ec1e468b7dd723e1571dbd41d6f30a201d.tar.xz linux-dd05f5ec1e468b7dd723e1571dbd41d6f30a201d.zip |
mm: use vma_pages() for vma objects
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>
Diffstat (limited to 'mm/internal.h')
-rw-r--r-- | mm/internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
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) |