diff mbox series

[-next] mm/filemap: avoid type conversion

Message ID 20240108044815.3291487-1-lihongbo22@huawei.com (mailing list archive)
State New
Headers show
Series [-next] mm/filemap: avoid type conversion | expand

Commit Message

Hongbo Li Jan. 8, 2024, 4:48 a.m. UTC
The return type of function folio_test_hugetlb is bool type, there is no
need to assign it to an integer type.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Wilcox Jan. 8, 2024, 5:01 a.m. UTC | #1
On Mon, Jan 08, 2024 at 12:48:15PM +0800, Hongbo Li wrote:
> The return type of function folio_test_hugetlb is bool type, there is no
> need to assign it to an integer type.
> 
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
diff mbox series

Patch

diff --git a/mm/filemap.c b/mm/filemap.c
index 750e779c23db..0d7e20edf46f 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -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;