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>
This commit is contained in:
parent
6e6f1b307e
commit
ab4d2986e4
|
@ -282,12 +282,8 @@ static int srcu_readers_active(struct srcu_struct *sp)
|
||||||
*/
|
*/
|
||||||
void cleanup_srcu_struct(struct srcu_struct *sp)
|
void cleanup_srcu_struct(struct srcu_struct *sp)
|
||||||
{
|
{
|
||||||
int sum;
|
if (WARN_ON(srcu_readers_active(sp)))
|
||||||
|
return; /* Leakage unless caller handles error. */
|
||||||
sum = srcu_readers_active(sp);
|
|
||||||
WARN_ON(sum); /* Leakage unless caller handles error. */
|
|
||||||
if (sum != 0)
|
|
||||||
return;
|
|
||||||
free_percpu(sp->per_cpu_ref);
|
free_percpu(sp->per_cpu_ref);
|
||||||
sp->per_cpu_ref = NULL;
|
sp->per_cpu_ref = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user