diff mbox series

block: fix boolreturn.cocci warning

Message ID 20220121094732.1002257-1-deng.changcheng@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series block: fix boolreturn.cocci warning | expand

Commit Message

CGEL Jan. 21, 2022, 9:47 a.m. UTC
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 mbox series

Patch

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;
 }