rcutorture: Clean up rcu_torture_init() error checking
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 31 Jan 2014 23:15:02 +0000 (15:15 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 23 Feb 2014 17:03:19 +0000 (09:03 -0800)
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>
kernel/rcu/rcutorture.c

index 897b0f91f8991d55a442e0603e35b75a45ae48bf..746c4278ea5e3f0abccf73ec08486e1b6e397870 100644 (file)
@@ -1460,7 +1460,6 @@ rcu_torture_init(void)
        int i;
        int cpu;
        int firsterr = 0;
-       int retval;
        static struct rcu_torture_ops *torture_ops[] = {
                &rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops,
        };
@@ -1629,33 +1628,23 @@ rcu_torture_init(void)
                for_each_possible_cpu(i) {
                        if (cpu_is_offline(i))
                                continue;  /* Heuristic: CPU can go offline. */
-                       retval = rcutorture_booster_init(i);
-                       if (retval < 0) {
-                               firsterr = retval;
+                       firsterr = rcutorture_booster_init(i);
+                       if (firsterr)
                                goto unwind;
-                       }
                }
        }
-       i = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup);
-       if (i != 0) {
-               firsterr = i;
+       firsterr = torture_shutdown_init(shutdown_secs, rcu_torture_cleanup);
+       if (firsterr)
                goto unwind;
-       }
-       i = torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ);
-       if (i != 0) {
-               firsterr = i;
+       firsterr = torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ);
+       if (firsterr)
                goto unwind;
-       }
-       i = rcu_torture_stall_init();
-       if (i != 0) {
-               firsterr = i;
+       firsterr = rcu_torture_stall_init();
+       if (firsterr)
                goto unwind;
-       }
-       retval = rcu_torture_barrier_init();
-       if (retval != 0) {
-               firsterr = retval;
+       firsterr = rcu_torture_barrier_init();
+       if (firsterr)
                goto unwind;
-       }
        if (object_debug)
                rcu_test_debug_objects();
        rcutorture_record_test_transition();