From: Joey Pabalinas <joeypabalinas@gmail.com>
To: Wen Yang <wen.yang99@zte.com.cn>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn,
Joey Pabalinas <joeypabalinas@gmail.com>
Subject: Re: [PATCH] sched/fair: Fix assignment of boolean variables
Date: Sat, 1 Dec 2018 11:32:16 -1000 [thread overview]
Message-ID: <20181201213216.wmikdw3emxhc7m5r@gmail.com> (raw)
In-Reply-To: <20181201090936.10175-1-wen.yang99@zte.com.cn>
[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]
On Sat, Dec 01, 2018 at 05:09:36PM +0800, Wen Yang wrote:
> Fix the following warnings reported by coccinelle:
> kernel//sched/fair.c:7958:3-12: WARNING: Assignment of bool to 0/1
>
> This also makes the code more readable.
>
> Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
> CC: Ingo Molnar <mingo@redhat.com>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: linux-kernel@vger.kernel.org
Ack, earlier assignments in the function like:
if (nr_running > 1)
*overload = true;
use `= true`, so this change keeps things consistent.
Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index a2e8160968cb..f19aa66f9b15 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7955,7 +7955,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
> if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
> sgs->group_misfit_task_load < rq->misfit_task_load) {
> sgs->group_misfit_task_load = rq->misfit_task_load;
> - *overload = 1;
> + *overload = true;
> }
> }
>
> --
> 2.19.1
>
--
Cheers,
Joey Pabalinas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-12-01 21:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-01 9:09 [PATCH] sched/fair: Fix assignment of boolean variables Wen Yang
2018-12-01 21:32 ` Joey Pabalinas [this message]
2018-12-03 8:33 ` Peter Zijlstra
2018-12-03 10:03 ` Valentin Schneider
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181201213216.wmikdw3emxhc7m5r@gmail.com \
--to=joeypabalinas@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=wen.yang99@zte.com.cn \
--cc=zhong.weidong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox