From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Zou Wei <zou_wei@huawei.com>,
paulmck@kernel.org, peterz@infradead.org,
akpm@linux-foundation.org, abelits@marvell.com
Cc: pjt@google.com, jinyuqi@huawei.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] cpumask: use false and true for bool variables
Date: Mon, 9 Nov 2020 07:58:01 -0500 [thread overview]
Message-ID: <80dd8254-c762-312f-c619-e7fc79673895@windriver.com> (raw)
In-Reply-To: <1604923190-70981-1-git-send-email-zou_wei@huawei.com>
On 2020-11-09 6:59 a.m., Zou Wei wrote:
> Fix coccicheck warnings:
>
> ./lib/cpumask.c:342:6-13: WARNING: Comparison of 0/1 to bool variable
> ./lib/cpumask.c:351:33-40: WARNING: Comparison of 0/1 to bool variable
> ./lib/cpumask.c:406:3-11: WARNING: Assignment of 0/1 to bool variable
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
It seems "Hulk Robot" needs an AI "tune-up". I didn't touch any of
these lines of code - and I'm guessing they haven't changed in years.
Paul.
--
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
> lib/cpumask.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/cpumask.c b/lib/cpumask.c
> index 34ecb30..74d0cf1 100644
> --- a/lib/cpumask.c
> +++ b/lib/cpumask.c
> @@ -339,7 +339,7 @@ static int find_nearest_node(int *node_dist, bool *used)
>
> /* Choose the first unused node to compare */
> for (i = 0; i < nr_node_ids; i++) {
> - if (used[i] == 0) {
> + if (used[i] == false) {
> min_dist = node_dist[i];
> node_id = i;
> break;
> @@ -348,7 +348,7 @@ static int find_nearest_node(int *node_dist, bool *used)
>
> /* Compare and return the nearest node */
> for (i = 0; i < nr_node_ids; i++) {
> - if (node_dist[i] < min_dist && used[i] == 0) {
> + if (node_dist[i] < min_dist && used[i] == false) {
> min_dist = node_dist[i];
> node_id = i;
> }
> @@ -403,7 +403,7 @@ unsigned int cpumask_local_spread(unsigned int i, int node)
> flags);
> return cpu;
> }
> - used[id] = 1;
> + used[id] = true;
> }
> spin_unlock_irqrestore(&spread_lock, flags);
>
>
prev parent reply other threads:[~2020-11-09 13:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 11:59 Zou Wei
2020-11-09 12:55 ` Peter Zijlstra
2020-11-09 12:58 ` Paul Gortmaker [this message]
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=80dd8254-c762-312f-c619-e7fc79673895@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=abelits@marvell.com \
--cc=akpm@linux-foundation.org \
--cc=jinyuqi@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=zou_wei@huawei.com \
/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
all inboxes | Powered by JetHome®