From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Nicholas Mc Guire <der.herr@hofr.at>
Cc: Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] rcu: use bool value directly
Date: Sat, 25 Mar 2017 16:36:21 -0700 [thread overview]
Message-ID: <20170325233621.GT3637@linux.vnet.ibm.com> (raw)
In-Reply-To: <1490471162-21390-1-git-send-email-der.herr@hofr.at>
On Sat, Mar 25, 2017 at 08:46:01PM +0100, Nicholas Mc Guire wrote:
> beenonline is declared bool so no need for an explicit comparison
>
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Queued both for review and testing, thank you!
Thanx, Paul
> ---
>
> Found by coccinelle: boolinit.cocci complained about
> ./kernel/rcu/tree.c:2986:14-29: WARNING: Comparison of bool to 0/1
>
> If the comparison was intended for readability I guess it should be
> against "false" not 0 - but it seems common to just use bool values
> directly.
>
> Patch was compile-tested with: x86_64_defconfig (implies CONFIG_TREE_RCU=y)
> (with some sparse warnings)
>
> Patch is against 4.11-rc3 (localversion-next is next-20170324)
>
> kernel/rcu/tree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 712ddce..ab9fbec 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2983,7 +2983,7 @@ __rcu_process_callbacks(struct rcu_state *rsp)
> bool needwake;
> struct rcu_data *rdp = raw_cpu_ptr(rsp->rda);
>
> - WARN_ON_ONCE(rdp->beenonline == 0);
> + WARN_ON_ONCE(!rdp->beenonline);
>
> /* Update RCU state based on any recent quiescent states. */
> rcu_check_quiescent_state(rsp, rdp);
> --
> 2.1.4
>
prev parent reply other threads:[~2017-03-26 1:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 19:46 Nicholas Mc Guire
2017-03-25 19:46 ` [PATCH 2/2] rcu: tree_plugin.h: use true/false in assignment to bool Nicholas Mc Guire
2017-03-25 23:36 ` Paul E. McKenney [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=20170325233621.GT3637@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=der.herr@hofr.at \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
/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
Powered by JetHome