diff mbox series

mm/hugetlb: use helper function range_in_vma() in page_table_shareable()

Message ID 20210204112949.43051-1-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series mm/hugetlb: use helper function range_in_vma() in page_table_shareable() | expand

Commit Message

Miaohe Lin Feb. 4, 2021, 11:29 a.m. UTC
We could use helper function range_in_vma() to check whether the vma is in
the desired range to simplify the code.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Kravetz Feb. 4, 2021, 9:37 p.m. UTC | #1
On 2/4/21 3:29 AM, Miaohe Lin wrote:
> We could use helper function range_in_vma() to check whether the vma is in
> the desired range to simplify the code.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/hugetlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
diff mbox series

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index cf82629319ed..442705be052a 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5237,7 +5237,7 @@  static unsigned long page_table_shareable(struct vm_area_struct *svma,
 	 */
 	if (pmd_index(addr) != pmd_index(saddr) ||
 	    vm_flags != svm_flags ||
-	    sbase < svma->vm_start || svma->vm_end < s_end)
+	    !range_in_vma(svma, sbase, s_end))
 		return 0;
 
 	return saddr;