Commit 01025ebc authored by Paul E. McKenney's avatar Paul E. McKenney

rcutorture: Clean up rcu_torture_init() error checking

This commit applies some simple cleanups to rcu_torture_init() error
checking.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent e991dbc0
...@@ -1460,7 +1460,6 @@ rcu_torture_init(void) ...@@ -1460,7 +1460,6 @@ rcu_torture_init(void)
int i; int i;
int cpu; int cpu;
int firsterr = 0; int firsterr = 0;
int retval;
static struct rcu_torture_ops *torture_ops[] = { static struct rcu_torture_ops *torture_ops[] = {
&rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops, &rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops,
}; };
...@@ -1629,33 +1628,23 @@ rcu_torture_init(void) ...@@ -1629,33 +1628,23 @@ rcu_torture_init(void)
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
if (cpu_is_offline(i)) if (cpu_is_offline(i))
continue; /* Heuristic: CPU can go offline. */ continue; /* Heuristic: CPU can go offline. */
retval = rcutorture_booster_init(i); firsterr = rcutorture_booster_init(i);
if (retval < 0) { if (firsterr)
firsterr = retval;
goto unwind; goto unwind;
}
} }
} }
i = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup); firsterr = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup);
if (i != 0) { if (firsterr)
firsterr = i;
goto unwind; goto unwind;
} firsterr = torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ);
i = torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ); if (firsterr)
if (i != 0) {
firsterr = i;
goto unwind; goto unwind;
} firsterr = rcu_torture_stall_init();
i = rcu_torture_stall_init(); if (firsterr)
if (i != 0) {
firsterr = i;
goto unwind; goto unwind;
} firsterr = rcu_torture_barrier_init();
retval = rcu_torture_barrier_init(); if (firsterr)
if (retval != 0) {
firsterr = retval;
goto unwind; goto unwind;
}
if (object_debug) if (object_debug)
rcu_test_debug_objects(); rcu_test_debug_objects();
rcutorture_record_test_transition(); rcutorture_record_test_transition();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment