From: "Paul E. McKenney" Adds SRCU operations to rcutorture and updates rcutorture documentation. Signed-off-by: Paul E. McKenney DESC srcu-2-add-srcu-operations-to-rcutorture-fix EDESC From: Andrew Morton argh, zombiecode. Cc: "Paul E. McKenney" Signed-off-by: Andrew Morton --- kernel/rcutorture.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff -puN kernel/rcutorture.c~srcu-2-add-srcu-operations-to-rcutorture kernel/rcutorture.c --- a/kernel/rcutorture.c~srcu-2-add-srcu-operations-to-rcutorture +++ a/kernel/rcutorture.c @@ -304,7 +304,7 @@ static void srcu_torture_cleanup(void) static int srcu_torture_read_lock(void) { - return (srcu_read_lock(&srcu_ctl)); + return srcu_read_lock(&srcu_ctl); } static void srcu_torture_read_unlock(int idx) @@ -348,11 +348,11 @@ static int srcu_torture_stats(char *page torture_type, TORTURE_FLAG, idx); for_each_possible_cpu(cpu) { cnt += sprintf(&page[cnt], " %d(%d,%d)", cpu, - srcu_ctl.per_cpu_ref[cpu].c[!idx], - srcu_ctl.per_cpu_ref[cpu].c[idx]); + per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx], + per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx]); } cnt += sprintf(&page[cnt], "\n"); - return (cnt); + return cnt; } static struct rcu_torture_ops srcu_ops = { @@ -693,14 +693,13 @@ rcu_torture_init(void) for (i = 0; cur_ops = torture_ops[i], cur_ops != NULL; i++) { cur_ops = torture_ops[i]; - if (strcmp(torture_type, cur_ops->name) == 0) { + if (strcmp(torture_type, cur_ops->name) == 0) break; - } } if (cur_ops == NULL) { printk(KERN_ALERT "rcutorture: invalid torture type: \"%s\"\n", torture_type); - return (-EINVAL); + return -EINVAL; } if (cur_ops->init != NULL) cur_ops->init(); /* no "goto unwind" prior to this point!!! */ _