[PATCH] block: fix boolreturn.cocci warning

cgel.zte@gmail.com posted 1 patch 4 years, 5 months ago
block/bio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] block: fix boolreturn.cocci warning
Posted by cgel.zte@gmail.com 4 years, 5 months ago
From: Changcheng Deng <deng.changcheng@zte.com.cn>

./block/bio.c: 1057: 9-10: WARNING:
return of 0/1 in function 'bio_add_folio' with return type bool

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

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
 block/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/bio.c b/block/bio.c
index 4312a8085396..108b11106c8d 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1054,7 +1054,7 @@ bool bio_add_folio(struct bio *bio, struct folio *folio, size_t len,
 		   size_t off)
 {
 	if (len > UINT_MAX || off > UINT_MAX)
-		return 0;
+		return false;
 	return bio_add_page(bio, &folio->page, len, off) > 0;
 }
 
-- 
2.25.1