aboutsummaryrefslogtreecommitdiff
path: root/mm/damon
diff options
context:
space:
mode:
authorMiaohe Lin2022-03-16 16:15:28 +0800
committerMatthew Wilcox (Oracle)2022-03-21 13:01:36 -0400
commit2a3c4bce3edb0d54983384aa8a88c0da330638f4 (patch)
tree324aa89f1e42f796d24f6ad992c332ad3c53b352 /mm/damon
parent72e725887413f031fa72d27fea5795450bab1940 (diff)
mm/damon: minor cleanup for damon_pa_young
if need_lock is true but folio_trylock fails, we should return false instead of NULL to match the return value type exactly. No functional change intended. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'mm/damon')
-rw-r--r--mm/damon/paddr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index ae24549921e2..74c2b6e1ca48 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -152,7 +152,7 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *page_sz)
need_lock = !folio_test_anon(folio) || folio_test_ksm(folio);
if (need_lock && !folio_trylock(folio)) {
folio_put(folio);
- return NULL;
+ return false;
}
rmap_walk(folio, &rwc);