[PATCH] block: fix boolreturn.cocci warning

From: cgel . zte
Date: Fri Jan 21 2022 - 04:47:43 EST


From: Changcheng Deng <deng.changcheng@xxxxxxxxxx>

./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@xxxxxxxxxx>
Signed-off-by: Changcheng Deng <deng.changcheng@xxxxxxxxxx>
---
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