[PATCH 3/8] srcu: simple cleanup for cleanup_srcu_struct()

From: Lai Jiangshan
Date: Thu Nov 29 2012 - 03:45:23 EST


Pack 6 lines of code into 2 lines.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
kernel/srcu.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/srcu.c b/kernel/srcu.c
index 48d0edb..ac08970 100644
--- a/kernel/srcu.c
+++ b/kernel/srcu.c
@@ -278,12 +278,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;
}
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/