Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 017c4261 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Ingo Molnar
Browse files

rcu: Fix sparse warnings



Rename local variable "i" in rcu_init() to avoid conflict with
RCU_INIT_FLAVOR(), restrict the scope of RCU_TREE_NONCORE, and
make __synchronize_srcu() static.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: josh@joshtriplett.org
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: Valdis.Kletnieks@vt.edu
Cc: dhowells@redhat.com
LKML-Reference: <12635142581560-git-send-email->
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 4c54005c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1888,7 +1888,7 @@ do { \

void __init rcu_init(void)
{
	int i;
	int cpu;

	rcu_bootup_announce();
#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
@@ -1908,8 +1908,8 @@ void __init rcu_init(void)
	 * or the scheduler are operational.
	 */
	cpu_notifier(rcu_cpu_notify, 0);
	for_each_online_cpu(i)
		rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)i);
	for_each_online_cpu(cpu)
		rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)cpu);
}

#include "rcutree_plugin.h"
+2 −4
Original line number Diff line number Diff line
@@ -323,8 +323,6 @@ struct rcu_state {
#define RCU_OFL_TASKS_EXP_GP	0x2		/* Tasks blocking expedited */
						/*  GP were moved to root. */

#ifdef RCU_TREE_NONCORE

/*
 * RCU implementation internal declarations:
 */
@@ -339,7 +337,7 @@ extern struct rcu_state rcu_preempt_state;
DECLARE_PER_CPU(struct rcu_data, rcu_preempt_data);
#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */

#else /* #ifdef RCU_TREE_NONCORE */
#ifndef RCU_TREE_NONCORE

/* Forward declarations for rcutree_plugin.h */
static void rcu_bootup_announce(void);
@@ -372,4 +370,4 @@ static void __cpuinit rcu_preempt_init_percpu_data(int cpu);
static void rcu_preempt_send_cbs_to_orphanage(void);
static void __init __rcu_init_preempt(void);

#endif /* #else #ifdef RCU_TREE_NONCORE */
#endif /* #ifndef RCU_TREE_NONCORE */
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ EXPORT_SYMBOL_GPL(srcu_read_unlock);
/*
 * Helper function for synchronize_srcu() and synchronize_srcu_expedited().
 */
void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void))
static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void))
{
	int idx;