rcu: Simplify sync_rcu_preempt_exp_init()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 20 Jan 2015 00:56:46 +0000 (16:56 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 11 Mar 2015 20:22:37 +0000 (13:22 -0700)
This commit eliminates a boolean and associated "if" statement by
rearranging the code.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree_plugin.h

index 0a571e9a0f1d00868c74c5032912c1a0b24dce94..d37c9fbdba71ff635d395f7fd6b6ede160fddf61 100644 (file)
@@ -677,19 +677,16 @@ static void
 sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp)
 {
        unsigned long flags;
-       int must_wait = 0;
 
        raw_spin_lock_irqsave(&rnp->lock, flags);
        smp_mb__after_unlock_lock();
        if (!rcu_preempt_has_tasks(rnp)) {
                raw_spin_unlock_irqrestore(&rnp->lock, flags);
+               rcu_report_exp_rnp(rsp, rnp, false); /* No tasks, report. */
        } else {
                rnp->exp_tasks = rnp->blkd_tasks.next;
                rcu_initiate_boost(rnp, flags);  /* releases rnp->lock */
-               must_wait = 1;
        }
-       if (!must_wait)
-               rcu_report_exp_rnp(rsp, rnp, false); /* Don't wake self. */
 }
 
 /**