[PATCH] rcu: move some code from macro to function

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lai Jiangshan
Date: Saturday, March 27, 2010 - 8:12 pm

cleanup: move some code from macro to function

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 3ec8160..112edb5 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1849,6 +1849,14 @@ static void __init rcu_init_one(struct rcu_state *rsp)
 			INIT_LIST_HEAD(&rnp->blocked_tasks[3]);
 		}
 	}
+
+	rnp = rsp->level[NUM_RCU_LVLS - 1];
+	for_each_possible_cpu(i) {
+		if (i > rnp->grphi)
+			rnp++;
+		rsp->rda[i]->mynode = rnp;
+		rcu_boot_init_percpu_data(i, rsp);
+	}
 }
 
 /*
@@ -1859,19 +1867,11 @@ static void __init rcu_init_one(struct rcu_state *rsp)
 #define RCU_INIT_FLAVOR(rsp, rcu_data) \
 do { \
 	int i; \
-	int j; \
-	struct rcu_node *rnp; \
 	\
-	rcu_init_one(rsp); \
-	rnp = (rsp)->level[NUM_RCU_LVLS - 1]; \
-	j = 0; \
 	for_each_possible_cpu(i) { \
-		if (i > rnp[j].grphi) \
-			j++; \
-		per_cpu(rcu_data, i).mynode = &rnp[j]; \
 		(rsp)->rda[i] = &per_cpu(rcu_data, i); \
-		rcu_boot_init_percpu_data(i, rsp); \
 	} \
+	rcu_init_one(rsp); \
 } while (0)
 
 void __init rcu_init(void)

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] rcu: move some code from macro to function, Lai Jiangshan, (Sat Mar 27, 8:12 pm)
Re: [PATCH] rcu: move some code from macro to function, Paul E. McKenney, (Sat Mar 27, 9:15 pm)
Re: [PATCH] rcu: move some code from macro to function, Lai Jiangshan, (Sun Mar 28, 6:03 pm)