Skip to content

Commit e75858b

Browse files
MiaoheLinakpm00
authored andcommitted
mm/huge_memory: use helper macro IS_ERR_OR_NULL in split_huge_pages_pid
Use helper macro IS_ERR_OR_NULL to check the validity of page to simplify the code. Minor readability improvement. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Miaohe Lin <[email protected]> Reviewed-by: Muchun Song <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Yang Shi <[email protected]> Cc: Zach O'Keefe <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent cea3332 commit e75858b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mm/huge_memory.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,9 +2958,7 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start,
29582958
/* FOLL_DUMP to ignore special (like zero) pages */
29592959
page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP);
29602960

2961-
if (IS_ERR(page))
2962-
continue;
2963-
if (!page || is_zone_device_page(page))
2961+
if (IS_ERR_OR_NULL(page) || is_zone_device_page(page))
29642962
continue;
29652963

29662964
if (!is_transparent_hugepage(page))

0 commit comments

Comments
 (0)