Skip to contentSkip to conversation

objtool, perf: fix boolreturn.cocci warnings

PATCH New Julia Lawall 1 participant 1 message Jan 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 objtool, perf: fix boolreturn.cocci warnings

From: kbuild test robot <[email protected]>

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

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Fixes 4864b0702653 ("objtool, perf: Fix GCC 8 -Wrestrict error")
CC Josh Poimboeuf <[email protected]>

---

tree:   https://android.googlesource.com/kernel/common android-4.9-o-mr1
head:   58ce54880a03d9c27327434ba15281f5a7139671
commit: 4864b070265301ba88506ee407d51e058dcb0ad6 [42/51] objtool, perf: Fix GCC 8 -Wrestrict error

:::::: branch date: 29 hours ago
:::::: commit date: 9 weeks ago

 blk-throttle.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
block/blk-throttle.c +5 -5
@@ -597,7 +597,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 */
@@ -706,7 +706,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,
@@ -748,7 +748,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;
 }
 
 /*
@@ -795,7 +795,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);
@@ -806,7 +806,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_charge_bio(struct throtl_grp *tg, struct bio *bio)