rcu: Use IS_ENABLED() to CONFIG_RCU_FANOUT_EXACT #ifdef
This commit uses IS_ENABLED() to remove the #ifdef from the rcu_init_levelspread() functions. No effect on executable code. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
9bae6592d7
commit
6629240575
1 changed files with 13 additions and 17 deletions
|
@ -3734,30 +3734,26 @@ void rcu_scheduler_starting(void)
|
||||||
* Compute the per-level fanout, either using the exact fanout specified
|
* Compute the per-level fanout, either using the exact fanout specified
|
||||||
* or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT.
|
* or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_RCU_FANOUT_EXACT
|
|
||||||
static void __init rcu_init_levelspread(struct rcu_state *rsp)
|
static void __init rcu_init_levelspread(struct rcu_state *rsp)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
rsp->levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
|
if (IS_ENABLED(CONFIG_RCU_FANOUT_EXACT)) {
|
||||||
for (i = rcu_num_lvls - 2; i >= 0; i--)
|
rsp->levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
|
||||||
rsp->levelspread[i] = CONFIG_RCU_FANOUT;
|
for (i = rcu_num_lvls - 2; i >= 0; i--)
|
||||||
}
|
rsp->levelspread[i] = CONFIG_RCU_FANOUT;
|
||||||
#else /* #ifdef CONFIG_RCU_FANOUT_EXACT */
|
} else {
|
||||||
static void __init rcu_init_levelspread(struct rcu_state *rsp)
|
int ccur;
|
||||||
{
|
int cprv;
|
||||||
int ccur;
|
|
||||||
int cprv;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
cprv = nr_cpu_ids;
|
cprv = nr_cpu_ids;
|
||||||
for (i = rcu_num_lvls - 1; i >= 0; i--) {
|
for (i = rcu_num_lvls - 1; i >= 0; i--) {
|
||||||
ccur = rsp->levelcnt[i];
|
ccur = rsp->levelcnt[i];
|
||||||
rsp->levelspread[i] = (cprv + ccur - 1) / ccur;
|
rsp->levelspread[i] = (cprv + ccur - 1) / ccur;
|
||||||
cprv = ccur;
|
cprv = ccur;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* #else #ifdef CONFIG_RCU_FANOUT_EXACT */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper function for rcu_init() that initializes one rcu_state structure.
|
* Helper function for rcu_init() that initializes one rcu_state structure.
|
||||||
|
|
Loading…
Add table
Reference in a new issue