aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiapeng Chong <[email protected]>2022-01-28 12:34:54 +0800
committerJens Axboe <[email protected]>2022-02-02 07:50:00 -0700
commit455a844d6345639be682977b3f0126be446b702e (patch)
treea3de13d2c767d555519438f2904cc84e0734202b
parent3767c902719befe44067717fa893a9ef8cb8747d (diff)
block: fix boolreturn.cocci warning
Return statements in functions returning bool should use true/false instead of 1/0. ./block/bio.c:1081:9-10: WARNING: return of 0/1 in function 'bio_add_folio' with return type bool. Reported-by: Abaci Robot <[email protected]> Signed-off-by: Jiapeng Chong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/bio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c
index 03cefe81950f..2e19ca600fcd 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1078,7 +1078,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;
}