diff options
author | Josh Triplett <josh@kernel.org> | 2007-05-08 03:33:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:17 -0400 |
commit | ade5fb818fb1861fd5f84619c761920ade762b5d (patch) | |
tree | e82613433ced07fea20f974586919b11864e2bbc /kernel/rcutorture.c | |
parent | c8e5b163101c5d716f08e90b686da620baa022f1 (diff) |
rcutorture: Remove redundant assignment to cur_ops in for loop
The for loop in rcutorture_init uses the condition
cur_ops = torture_ops[i], cur_ops
but then makes the same assignment to cur_ops inside the loop. Remove the
redundant assignment inside the loop, and remove now-unnecessary braces.
Signed-off-by: Josh Triplett <josh@kernel.org>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r-- | kernel/rcutorture.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 17cba7a6b224..55ba82a85a66 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c | |||
@@ -502,10 +502,6 @@ static struct rcu_torture_ops sched_ops = { | |||
502 | .name = "sched" | 502 | .name = "sched" |
503 | }; | 503 | }; |
504 | 504 | ||
505 | static struct rcu_torture_ops *torture_ops[] = | ||
506 | { &rcu_ops, &rcu_sync_ops, &rcu_bh_ops, &rcu_bh_sync_ops, &srcu_ops, | ||
507 | &sched_ops, NULL }; | ||
508 | |||
509 | /* | 505 | /* |
510 | * RCU torture writer kthread. Repeatedly substitutes a new structure | 506 | * RCU torture writer kthread. Repeatedly substitutes a new structure |
511 | * for that pointed to by rcu_torture_current, freeing the old structure | 507 | * for that pointed to by rcu_torture_current, freeing the old structure |
@@ -872,16 +868,17 @@ rcu_torture_init(void) | |||
872 | int i; | 868 | int i; |
873 | int cpu; | 869 | int cpu; |
874 | int firsterr = 0; | 870 | int firsterr = 0; |
871 | static struct rcu_torture_ops *torture_ops[] = | ||
872 | { &rcu_ops, &rcu_sync_ops, &rcu_bh_ops, &rcu_bh_sync_ops, | ||
873 | &srcu_ops, &sched_ops, }; | ||
875 | 874 | ||
876 | /* Process args and tell the world that the torturer is on the job. */ | 875 | /* Process args and tell the world that the torturer is on the job. */ |
877 | 876 | for (i = 0; i < ARRAY_SIZE(torture_ops); i++) { | |
878 | for (i = 0; cur_ops = torture_ops[i], cur_ops; i++) { | ||
879 | cur_ops = torture_ops[i]; | 877 | cur_ops = torture_ops[i]; |
880 | if (strcmp(torture_type, cur_ops->name) == 0) { | 878 | if (strcmp(torture_type, cur_ops->name) == 0) |
881 | break; | 879 | break; |
882 | } | ||
883 | } | 880 | } |
884 | if (cur_ops == NULL) { | 881 | if (i == ARRAY_SIZE(torture_ops)) { |
885 | printk(KERN_ALERT "rcutorture: invalid torture type: \"%s\"\n", | 882 | printk(KERN_ALERT "rcutorture: invalid torture type: \"%s\"\n", |
886 | torture_type); | 883 | torture_type); |
887 | return (-EINVAL); | 884 | return (-EINVAL); |