diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-07-04 15:39:40 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-08-30 16:03:19 -0700 |
commit | f7dd7d44fd2db80bfb2c5f81e67b5404b4735312 (patch) | |
tree | d7ec6cd2d1f03d312a560d365d222a85b5be1e2d | |
parent | b97d23c51c9fee56b0c7598c323ab2846d873f2d (diff) | |
download | linux-f7dd7d44fd2db80bfb2c5f81e67b5404b4735312.tar.bz2 |
rcu: Simplify rcutorture_get_gp_data()
This commit restructures rcutorture_get_gp_data() to take advantage of
the fact that there is only one flavor of RCU.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | kernel/rcu/tree.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 46a32999020d..254c78377c22 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -597,21 +597,16 @@ EXPORT_SYMBOL_GPL(show_rcu_gp_kthreads); void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, unsigned long *gp_seq) { - struct rcu_state *rsp = NULL; - switch (test_type) { case RCU_FLAVOR: case RCU_BH_FLAVOR: case RCU_SCHED_FLAVOR: - rsp = &rcu_state; + *flags = READ_ONCE(rcu_state.gp_flags); + *gp_seq = rcu_seq_current(&rcu_state.gp_seq); break; default: break; } - if (rsp == NULL) - return; - *flags = READ_ONCE(rsp->gp_flags); - *gp_seq = rcu_seq_current(&rsp->gp_seq); } EXPORT_SYMBOL_GPL(rcutorture_get_gp_data); |