# \[PATCH v3 2/5\] mm/migrate.c: remove unnecessary rc != MIGRATEPAGE\_SUCCESS check in 'else' case

- From: Miaohe Lin \<linmiaohe@huawei.com\>
- Date: 2021-03-25 13:17:19 
- List: linux-mm
- Page: https://ratatoskr.run/linux-mm/2021/03/6315347
- Thread: https://ratatoskr.run/linux-mm/2021/03/6315346/t.md

```text
It's guaranteed that in the 'else' case of the rc == MIGRATEPAGE_SUCCESS
check, rc does not equal to MIGRATEPAGE_SUCCESS. Remove this unnecessary
check.

Reviewed-by: David Hildenbrand <redacted>
Reviewed-by: Yang Shi <redacted>
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 61e7f848b554..dacbdc9710ac 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1370,7 +1370,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
 out:
 	if (rc == MIGRATEPAGE_SUCCESS)
 		putback_active_hugepage(hpage);
-	else if (rc != -EAGAIN && rc != MIGRATEPAGE_SUCCESS)
+	else if (rc != -EAGAIN)
 		list_move_tail(&hpage->lru, ret);
 
 	/*
-- 
2.19.1


```
