From: kernel test robot <lkp(a)intel.com>
block/blk-throttle.c:956:9-10: WARNING: return of 0/1 in function
'tg_may_dispatch' with return type bool
block/blk-throttle.c:911:8-9: WARNING: return of 0/1 in function
'tg_with_in_bps_limit' with return type bool
block/blk-throttle.c:869:8-9: WARNING: return of 0/1 in function
'tg_with_in_iops_limit' with return type bool
block/blk-throttle.c:760:8-9: WARNING: return of 0/1 in function
'throtl_slice_used' 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
Fixes: 8214bf079208 ("scripts/dtc: Export YYLOC global declaration")
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
https://android.googlesource.com/kernel/goldfish android-3.18
head: dd54b61f1458c03f68fc019b4874d98f2f0ae3a5
commit: 8214bf079208b146e63cd0a3ce0ed335a87ce7b3 [396/1051] scripts/dtc: Export YYLOC
global declaration
:::::: branch date: 5 weeks ago
:::::: commit date: 3 months ago
blk-throttle.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -757,7 +757,7 @@ static bool throtl_slice_used(struct thr
if (time_in_range(jiffies, tg->slice_start[rw], tg->slice_end[rw]))
return false;
- return 1;
+ return true;
}
/* Trim the used slices and adjust slice start accordingly */
@@ -866,7 +866,7 @@ static bool tg_with_in_iops_limit(struct
if (wait)
*wait = jiffy_wait;
- return 0;
+ return false;
}
static bool tg_with_in_bps_limit(struct throtl_grp *tg, struct bio *bio,
@@ -908,7 +908,7 @@ static bool tg_with_in_bps_limit(struct
jiffy_wait = jiffy_wait + (jiffy_elapsed_rnd - jiffy_elapsed);
if (wait)
*wait = jiffy_wait;
- return 0;
+ return false;
}
/*
@@ -953,7 +953,7 @@ static bool tg_may_dispatch(struct throt
tg_with_in_iops_limit(tg, bio, &iops_wait)) {
if (wait)
*wait = 0;
- return 1;
+ return true;
}
max_wait = max(bps_wait, iops_wait);
@@ -964,7 +964,7 @@ static bool tg_may_dispatch(struct throt
if (time_before(tg->slice_end[rw], jiffies + max_wait))
throtl_extend_slice(tg, rw, jiffies + max_wait);
- return 0;
+ return false;
}
static void throtl_update_dispatch_stats(struct blkcg_gq *blkg, u64 bytes,