]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/damon: minor cleanup for damon_pa_young
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 16 Mar 2022 08:15:28 +0000 (16:15 +0800)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 21 Mar 2022 17:01:36 +0000 (13:01 -0400)
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>
mm/damon/paddr.c

index ae24549921e2ff89dcb614e4b0803b9c7fa8d4e3..74c2b6e1ca489643c69e41740c6e8d146a7f05fc 100644 (file)
@@ -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);