linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] include:page-flags: fix boolreturn.cocci warnings
@ 2021-08-24  6:11 CGEL
  0 siblings, 0 replies; only message in thread
From: CGEL @ 2021-08-24  6:11 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Wilcox, Vlastimil Babka, Oscar Salvador, David Howells,
	David Hildenbrand, Marc Zyngier, Roman Gushchin, linux-kernel,
	Jing Yangyang, Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

./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@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-24  6:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24  6:11 [PATCH linux-next] include:page-flags: fix boolreturn.cocci warnings CGEL

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).