diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-01-31 18:15:02 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-23 12:03:19 -0500 |
commit | 01025ebc99e39ac962c32e063cad9a3012ee8b0a (patch) | |
tree | bff4b96e2d5dacf6b86a1047e4c42354f8b3eac1 /kernel/rcu | |
parent | e991dbc0770b01b7dc7d6d7660442e83ebd11828 (diff) |
rcutorture: Clean up rcu_torture_init() error checking
This commit applies some simple cleanups to rcu_torture_init() error
checking.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/rcutorture.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 897b0f91f899..746c4278ea5e 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c | |||
@@ -1460,7 +1460,6 @@ rcu_torture_init(void) | |||
1460 | int i; | 1460 | int i; |
1461 | int cpu; | 1461 | int cpu; |
1462 | int firsterr = 0; | 1462 | int firsterr = 0; |
1463 | int retval; | ||
1464 | static struct rcu_torture_ops *torture_ops[] = { | 1463 | static struct rcu_torture_ops *torture_ops[] = { |
1465 | &rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops, | 1464 | &rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops, |
1466 | }; | 1465 | }; |
@@ -1629,33 +1628,23 @@ rcu_torture_init(void) | |||
1629 | for_each_possible_cpu(i) { | 1628 | for_each_possible_cpu(i) { |
1630 | if (cpu_is_offline(i)) | 1629 | if (cpu_is_offline(i)) |
1631 | continue; /* Heuristic: CPU can go offline. */ | 1630 | continue; /* Heuristic: CPU can go offline. */ |
1632 | retval = rcutorture_booster_init(i); | 1631 | firsterr = rcutorture_booster_init(i); |
1633 | if (retval < 0) { | 1632 | if (firsterr) |
1634 | firsterr = retval; | ||
1635 | goto unwind; | 1633 | goto unwind; |
1636 | } | ||
1637 | } | 1634 | } |
1638 | } | 1635 | } |
1639 | i = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup); | 1636 | firsterr = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup); |
1640 | if (i != 0) { | 1637 | if (firsterr) |
1641 | firsterr = i; | ||
1642 | goto unwind; | 1638 | goto unwind; |
1643 | } | 1639 | firsterr = torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ); |
1644 | i = torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ); | 1640 | if (firsterr) |
1645 | if (i != 0) { | ||
1646 | firsterr = i; | ||
1647 | goto unwind; | 1641 | goto unwind; |
1648 | } | 1642 | firsterr = rcu_torture_stall_init(); |
1649 | i = rcu_torture_stall_init(); | 1643 | if (firsterr) |
1650 | if (i != 0) { | ||
1651 | firsterr = i; | ||
1652 | goto unwind; | 1644 | goto unwind; |
1653 | } | 1645 | firsterr = rcu_torture_barrier_init(); |
1654 | retval = rcu_torture_barrier_init(); | 1646 | if (firsterr) |
1655 | if (retval != 0) { | ||
1656 | firsterr = retval; | ||
1657 | goto unwind; | 1647 | goto unwind; |
1658 | } | ||
1659 | if (object_debug) | 1648 | if (object_debug) |
1660 | rcu_test_debug_objects(); | 1649 | rcu_test_debug_objects(); |
1661 | rcutorture_record_test_transition(); | 1650 | rcutorture_record_test_transition(); |