[PATCH linux-next] include:page-flags: fix boolreturn.cocci warnings

From: CGEL
Date: Tue Aug 24 2021 - 02:11:58 EST


From: Jing Yangyang <jing.yangyang@xxxxxxxxxx>

./include/linux/page-flags.h:377:74-75:WARNING:return of 0/1 in
function 'folio_test_headhuge' with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Jing Yangyang <jing.yangyang@xxxxxxxxxx>
---
include/linux/page-flags.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index a68af80..aa743e6 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -374,7 +374,7 @@ static unsigned long *folio_flags(struct folio *folio, unsigned n)
TESTCLEARFLAG(uname, lname, policy)

#define TESTPAGEFLAG_FALSE(uname, lname) \
-static inline bool folio_test_##lname(const struct folio *folio) { return 0; } \
+static inline bool folio_test_##lname(const struct folio *folio) { return false; } \
static inline int Page##uname(const struct page *page) { return 0; }

#define SETPAGEFLAG_NOOP(uname, lname) \
@@ -391,12 +391,12 @@ static unsigned long *folio_flags(struct folio *folio, unsigned n)

#define TESTSETFLAG_FALSE(uname, lname) \
static inline bool folio_test_set_##lname(struct folio *folio) \
-{ return 0; } \
+{ return false; } \
static inline int TestSetPage##uname(struct page *page) { return 0; }

#define TESTCLEARFLAG_FALSE(uname, lname) \
static inline bool folio_test_clear_##lname(struct folio *folio) \
-{ return 0; } \
+{ return false; } \
static inline int TestClearPage##uname(struct page *page) { return 0; }

#define PAGEFLAG_FALSE(uname, lname) TESTPAGEFLAG_FALSE(uname, lname) \
--
1.8.3.1