Commit 3e5c3600 authored by Baoquan He's avatar Baoquan He Committed by Linus Torvalds

mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool

Patch series "mm/hugetlb: Small cleanup and improvement", v2.

This patch (of 3):

Just like its neighbour is_hugetlb_entry_migration() has done.
Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Link: https://lkml.kernel.org/r/20200723032248.24772-1-bhe@redhat.com
Link: https://lkml.kernel.org/r/20200723032248.24772-2-bhe@redhat.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ab00db21
...@@ -3805,17 +3805,17 @@ bool is_hugetlb_entry_migration(pte_t pte) ...@@ -3805,17 +3805,17 @@ bool is_hugetlb_entry_migration(pte_t pte)
return false; return false;
} }
static int is_hugetlb_entry_hwpoisoned(pte_t pte) static bool is_hugetlb_entry_hwpoisoned(pte_t pte)
{ {
swp_entry_t swp; swp_entry_t swp;
if (huge_pte_none(pte) || pte_present(pte)) if (huge_pte_none(pte) || pte_present(pte))
return 0; return false;
swp = pte_to_swp_entry(pte); swp = pte_to_swp_entry(pte);
if (non_swap_entry(swp) && is_hwpoison_entry(swp)) if (non_swap_entry(swp) && is_hwpoison_entry(swp))
return 1; return true;
else else
return 0; return false;
} }
int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment