diff mbox series

[2/5] mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool

Message ID 20200720062623.13135-3-bhe@redhat.com (mailing list archive)
State New, archived
Headers show
Series mm/hugetlb: Small cleanup and improvement | expand

Commit Message

Baoquan He July 20, 2020, 6:26 a.m. UTC
Just like his neighbour is_hugetlb_entry_migration() has done.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 mm/hugetlb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Mike Kravetz July 20, 2020, 10:34 p.m. UTC | #1
On 7/19/20 11:26 PM, Baoquan He wrote:
> Just like his neighbour is_hugetlb_entry_migration() has done.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>

Thanks,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
David Hildenbrand July 21, 2020, 9:56 a.m. UTC | #2
On 20.07.20 08:26, Baoquan He wrote:
> Just like his neighbour is_hugetlb_entry_migration() has done.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  mm/hugetlb.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 191a585bb315..a58f976a9dd9 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3754,17 +3754,17 @@ bool is_hugetlb_entry_migration(pte_t pte)
>  		return false;
>  }
>  
> -static int is_hugetlb_entry_hwpoisoned(pte_t pte)
> +static bool is_hugetlb_entry_hwpoisoned(pte_t pte)
>  {
>  	swp_entry_t swp;
>  
>  	if (huge_pte_none(pte) || pte_present(pte))
> -		return 0;
> +		return false;
>  	swp = pte_to_swp_entry(pte);
>  	if (non_swap_entry(swp) && is_hwpoison_entry(swp))
> -		return 1;
> +		return true;
>  	else
> -		return 0;
> +		return false;
>  }
>  
>  int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 191a585bb315..a58f976a9dd9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3754,17 +3754,17 @@  bool is_hugetlb_entry_migration(pte_t pte)
 		return false;
 }
 
-static int is_hugetlb_entry_hwpoisoned(pte_t pte)
+static bool is_hugetlb_entry_hwpoisoned(pte_t pte)
 {
 	swp_entry_t swp;
 
 	if (huge_pte_none(pte) || pte_present(pte))
-		return 0;
+		return false;
 	swp = pte_to_swp_entry(pte);
 	if (non_swap_entry(swp) && is_hwpoison_entry(swp))
-		return 1;
+		return true;
 	else
-		return 0;
+		return false;
 }
 
 int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,