diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2012-11-29 09:46:04 +0100 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-02-08 00:10:10 +0100 |
commit | ab4d2986e44c589aa1b647d7da5e21c2707babea (patch) | |
tree | e5400a89ca0f137125be973016c6391a701a790c /kernel/srcu.c | |
parent | srcu: Add might_sleep() annotation to synchronize_srcu() (diff) | |
download | linux-ab4d2986e44c589aa1b647d7da5e21c2707babea.tar.xz linux-ab4d2986e44c589aa1b647d7da5e21c2707babea.zip |
srcu: Simple cleanup for cleanup_srcu_struct()
Pack six lines of code into two lines.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/srcu.c')
-rw-r--r-- | kernel/srcu.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/srcu.c b/kernel/srcu.c index 3e43a214b4dc..7cf5baba96f9 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c @@ -282,12 +282,8 @@ static int srcu_readers_active(struct srcu_struct *sp) */ void cleanup_srcu_struct(struct srcu_struct *sp) { - int sum; - - sum = srcu_readers_active(sp); - WARN_ON(sum); /* Leakage unless caller handles error. */ - if (sum != 0) - return; + if (WARN_ON(srcu_readers_active(sp))) + return; /* Leakage unless caller handles error. */ free_percpu(sp->per_cpu_ref); sp->per_cpu_ref = NULL; } |