Skip to content

Commit

Permalink
srcu: Simple cleanup for cleanup_srcu_struct()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed Feb 7, 2013
1 parent 6e6f1b3 commit ab4d298
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/srcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ab4d298

Please sign in to comment.