diff mbox series

[2/3] mm/memory-failure.c: minor cleanup for HWPoisonHandlable

Message ID 20220407130352.15618-3-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few fixup and cleanup patches for memory failure | expand

Commit Message

Miaohe Lin April 7, 2022, 1:03 p.m. UTC
The local variable movable can be removed by returning true directly. Also
fix typo 'mirgate'. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory-failure.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

David Hildenbrand April 8, 2022, 8:52 a.m. UTC | #1
On 07.04.22 15:03, Miaohe Lin wrote:
> The local variable movable can be removed by returning true directly. Also
> fix typo 'mirgate'. No functional change intended.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/memory-failure.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 2e97302d62e4..bd563f47630c 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1180,13 +1180,11 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>   */
>  static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>  {
> -	bool movable = false;
> -
> -	/* Soft offline could mirgate non-LRU movable pages */
> +	/* Soft offline could migrate non-LRU movable pages */
>  	if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
> -		movable = true;
> +		return true;
>  
> -	return movable || PageLRU(page) || is_free_buddy_page(page);
> +	return PageLRU(page) || is_free_buddy_page(page);
>  }
>  
>  static int __get_hwpoison_page(struct page *page, unsigned long flags)

Reviewed-by: David Hildenbrand <david@redhat.com>
Yang Shi April 8, 2022, 5:33 p.m. UTC | #2
On Thu, Apr 7, 2022 at 6:03 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> The local variable movable can be removed by returning true directly. Also
> fix typo 'mirgate'. No functional change intended.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Yang Shi <shy828301@gmail.com>

> ---
>  mm/memory-failure.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 2e97302d62e4..bd563f47630c 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1180,13 +1180,11 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>   */
>  static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>  {
> -       bool movable = false;
> -
> -       /* Soft offline could mirgate non-LRU movable pages */
> +       /* Soft offline could migrate non-LRU movable pages */
>         if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
> -               movable = true;
> +               return true;
>
> -       return movable || PageLRU(page) || is_free_buddy_page(page);
> +       return PageLRU(page) || is_free_buddy_page(page);
>  }
>
>  static int __get_hwpoison_page(struct page *page, unsigned long flags)
> --
> 2.23.0
>
HORIGUCHI NAOYA(堀口 直也) April 11, 2022, 1:14 p.m. UTC | #3
On Thu, Apr 07, 2022 at 09:03:51PM +0800, Miaohe Lin wrote:
> The local variable movable can be removed by returning true directly. Also
> fix typo 'mirgate'. No functional change intended.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>

> ---
>  mm/memory-failure.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 2e97302d62e4..bd563f47630c 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1180,13 +1180,11 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>   */
>  static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>  {
> -	bool movable = false;
> -
> -	/* Soft offline could mirgate non-LRU movable pages */
> +	/* Soft offline could migrate non-LRU movable pages */
>  	if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
> -		movable = true;
> +		return true;
>  
> -	return movable || PageLRU(page) || is_free_buddy_page(page);
> +	return PageLRU(page) || is_free_buddy_page(page);
>  }
>  
>  static int __get_hwpoison_page(struct page *page, unsigned long flags)
> -- 
> 2.23.0
diff mbox series

Patch

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 2e97302d62e4..bd563f47630c 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1180,13 +1180,11 @@  void ClearPageHWPoisonTakenOff(struct page *page)
  */
 static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
 {
-	bool movable = false;
-
-	/* Soft offline could mirgate non-LRU movable pages */
+	/* Soft offline could migrate non-LRU movable pages */
 	if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
-		movable = true;
+		return true;
 
-	return movable || PageLRU(page) || is_free_buddy_page(page);
+	return PageLRU(page) || is_free_buddy_page(page);
 }
 
 static int __get_hwpoison_page(struct page *page, unsigned long flags)