mm/filemap: avoid type conversion
authorHongbo Li <lihongbo22@huawei.com>
Mon, 8 Jan 2024 04:48:15 +0000 (12:48 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 00:00:02 +0000 (16:00 -0800)
The return type of function folio_test_hugetlb is bool type, there is no
need to assign it to an integer type.

Link: https://lkml.kernel.org/r/20240108044815.3291487-1-lihongbo22@huawei.com
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c

index 750e779c23db74730fa7743c2307d1b996729d62..0d7e20edf46f59801db10abeb7bf1e1c56bfc113 100644 (file)
@@ -843,7 +843,7 @@ noinline int __filemap_add_folio(struct address_space *mapping,
                struct folio *folio, pgoff_t index, gfp_t gfp, void **shadowp)
 {
        XA_STATE(xas, &mapping->i_pages, index);
-       int huge = folio_test_hugetlb(folio);
+       bool huge = folio_test_hugetlb(folio);
        bool charged = false;
        long nr = 1;