Skip to content

Commit c329120

Browse files
Hongbo LiFrederic Weisbecker
authored andcommitted
rcu: Use bitwise instead of arithmetic operator for flags
This silences the following coccinelle warning: WARNING: sum of probable bitmasks, consider | Signed-off-by: Hongbo Li <[email protected]> Reviewed-by: "Paul E. McKenney" <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 4a09e35 commit c329120

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

kernel/rcu/tree_plugin.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp)
183183
switch (blkd_state) {
184184
case 0:
185185
case RCU_EXP_TASKS:
186-
case RCU_EXP_TASKS + RCU_GP_BLKD:
186+
case RCU_EXP_TASKS | RCU_GP_BLKD:
187187
case RCU_GP_TASKS:
188-
case RCU_GP_TASKS + RCU_EXP_TASKS:
188+
case RCU_GP_TASKS | RCU_EXP_TASKS:
189189

190190
/*
191191
* Blocking neither GP, or first task blocking the normal
@@ -198,10 +198,10 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp)
198198

199199
case RCU_EXP_BLKD:
200200
case RCU_GP_BLKD:
201-
case RCU_GP_BLKD + RCU_EXP_BLKD:
202-
case RCU_GP_TASKS + RCU_EXP_BLKD:
203-
case RCU_GP_TASKS + RCU_GP_BLKD + RCU_EXP_BLKD:
204-
case RCU_GP_TASKS + RCU_EXP_TASKS + RCU_GP_BLKD + RCU_EXP_BLKD:
201+
case RCU_GP_BLKD | RCU_EXP_BLKD:
202+
case RCU_GP_TASKS | RCU_EXP_BLKD:
203+
case RCU_GP_TASKS | RCU_GP_BLKD | RCU_EXP_BLKD:
204+
case RCU_GP_TASKS | RCU_EXP_TASKS | RCU_GP_BLKD | RCU_EXP_BLKD:
205205

206206
/*
207207
* First task arriving that blocks either GP, or first task
@@ -214,9 +214,9 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp)
214214
list_add_tail(&t->rcu_node_entry, &rnp->blkd_tasks);
215215
break;
216216

217-
case RCU_EXP_TASKS + RCU_EXP_BLKD:
218-
case RCU_EXP_TASKS + RCU_GP_BLKD + RCU_EXP_BLKD:
219-
case RCU_GP_TASKS + RCU_EXP_TASKS + RCU_EXP_BLKD:
217+
case RCU_EXP_TASKS | RCU_EXP_BLKD:
218+
case RCU_EXP_TASKS | RCU_GP_BLKD | RCU_EXP_BLKD:
219+
case RCU_GP_TASKS | RCU_EXP_TASKS | RCU_EXP_BLKD:
220220

221221
/*
222222
* Second or subsequent task blocking the expedited GP.
@@ -227,8 +227,8 @@ static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data *rdp)
227227
list_add(&t->rcu_node_entry, rnp->exp_tasks);
228228
break;
229229

230-
case RCU_GP_TASKS + RCU_GP_BLKD:
231-
case RCU_GP_TASKS + RCU_EXP_TASKS + RCU_GP_BLKD:
230+
case RCU_GP_TASKS | RCU_GP_BLKD:
231+
case RCU_GP_TASKS | RCU_EXP_TASKS | RCU_GP_BLKD:
232232

233233
/*
234234
* Second or subsequent task blocking the normal GP.

0 commit comments

Comments
 (0)