From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5826799827082123867==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [PATCH] scripts/dtc: fix boolreturn.cocci warnings Date: Fri, 21 May 2021 02:22:55 +0800 Message-ID: <20210520182255.GA33660@ad678c5af442> In-Reply-To: <202105210256.1Q2XDf1M-lkp@intel.com> List-Id: --===============5826799827082123867== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kernel test robot block/blk-throttle.c:956:9-10: WARNING: return of 0/1 in function 'tg_may_d= ispatch' with return type bool block/blk-throttle.c:911:8-9: WARNING: return of 0/1 in function 'tg_with_i= n_bps_limit' with return type bool block/blk-throttle.c:869:8-9: WARNING: return of 0/1 in function 'tg_with_i= n_iops_limit' with return type bool block/blk-throttle.c:760:8-9: WARNING: return of 0/1 in function 'throtl_sl= ice_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 Signed-off-by: kernel test robot --- tree: https://android.googlesource.com/kernel/goldfish android-3.18 head: dd54b61f1458c03f68fc019b4874d98f2f0ae3a5 commit: 8214bf079208b146e63cd0a3ce0ed335a87ce7b3 [396/1051] scripts/dtc: Ex= port 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 =3D 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 =3D jiffy_wait + (jiffy_elapsed_rnd - jiffy_elapsed); if (wait) *wait =3D 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 =3D 0; - return 1; + return true; } = max_wait =3D 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, --===============5826799827082123867==--