提交 c701d5d9 编写于 作者: P Paul E. McKenney 提交者: Paul E. McKenney

rcu: Fix code-style issues involving "else"

The Linux kernel coding style says that single-statement blocks should
omit curly braces unless the other leg of the "if" statement has
multiple statements, in which case the curly braces should be included.
This commit fixes RCU's violations of this rule.
Signed-off-by: NPaul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
上级 02a0677b
...@@ -350,8 +350,9 @@ static int rcu_initiate_boost(void) ...@@ -350,8 +350,9 @@ static int rcu_initiate_boost(void)
rcu_preempt_ctrlblk.boost_tasks = rcu_preempt_ctrlblk.boost_tasks =
rcu_preempt_ctrlblk.gp_tasks; rcu_preempt_ctrlblk.gp_tasks;
invoke_rcu_callbacks(); invoke_rcu_callbacks();
} else } else {
RCU_TRACE(rcu_initiate_boost_trace()); RCU_TRACE(rcu_initiate_boost_trace());
}
return 1; return 1;
} }
...@@ -778,9 +779,9 @@ void synchronize_rcu_expedited(void) ...@@ -778,9 +779,9 @@ void synchronize_rcu_expedited(void)
rpcp->exp_tasks = NULL; rpcp->exp_tasks = NULL;
/* Wait for tail of ->blkd_tasks list to drain. */ /* Wait for tail of ->blkd_tasks list to drain. */
if (!rcu_preempted_readers_exp()) if (!rcu_preempted_readers_exp()) {
local_irq_restore(flags); local_irq_restore(flags);
else { } else {
rcu_initiate_boost(); rcu_initiate_boost();
local_irq_restore(flags); local_irq_restore(flags);
wait_event(sync_rcu_preempt_exp_wq, wait_event(sync_rcu_preempt_exp_wq,
......
...@@ -408,8 +408,9 @@ rcu_torture_cb(struct rcu_head *p) ...@@ -408,8 +408,9 @@ rcu_torture_cb(struct rcu_head *p)
if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) { if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) {
rp->rtort_mbtest = 0; rp->rtort_mbtest = 0;
rcu_torture_free(rp); rcu_torture_free(rp);
} else } else {
cur_ops->deferred_free(rp); cur_ops->deferred_free(rp);
}
} }
static int rcu_no_completed(void) static int rcu_no_completed(void)
......
...@@ -892,8 +892,9 @@ static void __note_new_gpnum(struct rcu_state *rsp, struct rcu_node *rnp, struct ...@@ -892,8 +892,9 @@ static void __note_new_gpnum(struct rcu_state *rsp, struct rcu_node *rnp, struct
if (rnp->qsmask & rdp->grpmask) { if (rnp->qsmask & rdp->grpmask) {
rdp->qs_pending = 1; rdp->qs_pending = 1;
rdp->passed_quiesce = 0; rdp->passed_quiesce = 0;
} else } else {
rdp->qs_pending = 0; rdp->qs_pending = 0;
}
zero_cpu_stall_ticks(rdp); zero_cpu_stall_ticks(rdp);
} }
} }
...@@ -2130,9 +2131,9 @@ void synchronize_sched_expedited(void) ...@@ -2130,9 +2131,9 @@ void synchronize_sched_expedited(void)
put_online_cpus(); put_online_cpus();
/* No joy, try again later. Or just synchronize_sched(). */ /* No joy, try again later. Or just synchronize_sched(). */
if (trycount++ < 10) if (trycount++ < 10) {
udelay(trycount * num_online_cpus()); udelay(trycount * num_online_cpus());
else { } else {
synchronize_sched(); synchronize_sched();
return; return;
} }
......
...@@ -390,8 +390,9 @@ void rcu_read_unlock_special(struct task_struct *t) ...@@ -390,8 +390,9 @@ void rcu_read_unlock_special(struct task_struct *t)
rnp->grphi, rnp->grphi,
!!rnp->gp_tasks); !!rnp->gp_tasks);
rcu_report_unblock_qs_rnp(rnp, flags); rcu_report_unblock_qs_rnp(rnp, flags);
} else } else {
raw_spin_unlock_irqrestore(&rnp->lock, flags); raw_spin_unlock_irqrestore(&rnp->lock, flags);
}
#ifdef CONFIG_RCU_BOOST #ifdef CONFIG_RCU_BOOST
/* Unboost if we were boosted. */ /* Unboost if we were boosted. */
...@@ -757,9 +758,9 @@ sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp) ...@@ -757,9 +758,9 @@ sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp)
int must_wait = 0; int must_wait = 0;
raw_spin_lock_irqsave(&rnp->lock, flags); raw_spin_lock_irqsave(&rnp->lock, flags);
if (list_empty(&rnp->blkd_tasks)) if (list_empty(&rnp->blkd_tasks)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags); raw_spin_unlock_irqrestore(&rnp->lock, flags);
else { } else {
rnp->exp_tasks = rnp->blkd_tasks.next; rnp->exp_tasks = rnp->blkd_tasks.next;
rcu_initiate_boost(rnp, flags); /* releases rnp->lock */ rcu_initiate_boost(rnp, flags); /* releases rnp->lock */
must_wait = 1; must_wait = 1;
...@@ -803,9 +804,9 @@ void synchronize_rcu_expedited(void) ...@@ -803,9 +804,9 @@ void synchronize_rcu_expedited(void)
* expedited grace period for us, just leave. * expedited grace period for us, just leave.
*/ */
while (!mutex_trylock(&sync_rcu_preempt_exp_mutex)) { while (!mutex_trylock(&sync_rcu_preempt_exp_mutex)) {
if (trycount++ < 10) if (trycount++ < 10) {
udelay(trycount * num_online_cpus()); udelay(trycount * num_online_cpus());
else { } else {
synchronize_rcu(); synchronize_rcu();
return; return;
} }
...@@ -2093,8 +2094,9 @@ static void rcu_prepare_for_idle(int cpu) ...@@ -2093,8 +2094,9 @@ static void rcu_prepare_for_idle(int cpu)
if (rcu_cpu_has_callbacks(cpu)) { if (rcu_cpu_has_callbacks(cpu)) {
trace_rcu_prep_idle("More callbacks"); trace_rcu_prep_idle("More callbacks");
invoke_rcu_core(); invoke_rcu_core();
} else } else {
trace_rcu_prep_idle("Callbacks drained"); trace_rcu_prep_idle("Callbacks drained");
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册