[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1490471162-21390-1-git-send-email-der.herr@hofr.at>
Date: Sat, 25 Mar 2017 20:46:01 +0100
From: Nicholas Mc Guire <der.herr@...r.at>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
linux-kernel@...r.kernel.org, Nicholas Mc Guire <der.herr@...r.at>
Subject: [PATCH 1/2] rcu: use bool value directly
beenonline is declared bool so no need for an explicit comparison
Signed-off-by: Nicholas Mc Guire <der.herr@...r.at>
---
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
Powered by blists - more mailing lists