[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210306032947.35921-2-linmiaohe@huawei.com>
Date: Fri, 5 Mar 2021 22:29:44 -0500
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>, <kirill.shutemov@...ux.intel.com>
CC: <riel@...hat.com>, <ebru.akagunduz@...il.com>,
<dan.carpenter@...cle.com>, <linux-kernel@...r.kernel.org>,
<linux-mm@...ck.org>, <linmiaohe@...wei.com>
Subject: [PATCH v2 1/4] khugepaged: remove unneeded return value of khugepaged_collapse_pte_mapped_thps()
The return value of khugepaged_collapse_pte_mapped_thps() is never checked
since it's introduced. We should remove such unneeded return value.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
---
mm/khugepaged.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index a7d6cb912b05..d43812c5ce16 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1533,16 +1533,16 @@ void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr)
goto drop_hpage;
}
-static int khugepaged_collapse_pte_mapped_thps(struct mm_slot *mm_slot)
+static void khugepaged_collapse_pte_mapped_thps(struct mm_slot *mm_slot)
{
struct mm_struct *mm = mm_slot->mm;
int i;
if (likely(mm_slot->nr_pte_mapped_thp == 0))
- return 0;
+ return;
if (!mmap_write_trylock(mm))
- return -EBUSY;
+ return;
if (unlikely(khugepaged_test_exit(mm)))
goto out;
@@ -1553,7 +1553,6 @@ static int khugepaged_collapse_pte_mapped_thps(struct mm_slot *mm_slot)
out:
mm_slot->nr_pte_mapped_thp = 0;
mmap_write_unlock(mm);
- return 0;
}
static void retract_page_tables(struct address_space *mapping, pgoff_t pgoff)
@@ -2057,9 +2056,8 @@ static void khugepaged_scan_file(struct mm_struct *mm,
BUILD_BUG();
}
-static int khugepaged_collapse_pte_mapped_thps(struct mm_slot *mm_slot)
+static void khugepaged_collapse_pte_mapped_thps(struct mm_slot *mm_slot)
{
- return 0;
}
#endif
--
2.19.1
Powered by blists - more mailing lists