Skip to content

Commit c30fe54

Browse files
committed
rcu: Mark non-global functions and variables as static
Each of rcu_state, rcu_rnp_online_cpus(), rcu_dynticks_curr_cpu_in_eqs(), and rcu_dynticks_snap() are used only in the kernel/rcu/tree.o translation unit, and may thus be marked static. This commit therefore makes this change. Reported-by: Ben Dooks <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Joel Fernandes (Google) <[email protected]>
1 parent 4414abf commit c30fe54

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

kernel/rcu/tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data) = {
8484
.dynticks_nmi_nesting = DYNTICK_IRQ_NONIDLE,
8585
.dynticks = ATOMIC_INIT(RCU_DYNTICK_CTRL_CTR),
8686
};
87-
struct rcu_state rcu_state = {
87+
static struct rcu_state rcu_state = {
8888
.level = { &rcu_state.node[0] },
8989
.gp_state = RCU_GP_IDLE,
9090
.gp_seq = (0UL - 300UL) << RCU_SEQ_CTR_SHIFT,
@@ -188,7 +188,7 @@ EXPORT_SYMBOL_GPL(rcu_get_gp_kthreads_prio);
188188
* held, but the bit corresponding to the current CPU will be stable
189189
* in most contexts.
190190
*/
191-
unsigned long rcu_rnp_online_cpus(struct rcu_node *rnp)
191+
static unsigned long rcu_rnp_online_cpus(struct rcu_node *rnp)
192192
{
193193
return READ_ONCE(rnp->qsmaskinitnext);
194194
}
@@ -294,7 +294,7 @@ static void rcu_dynticks_eqs_online(void)
294294
*
295295
* No ordering, as we are sampling CPU-local information.
296296
*/
297-
bool rcu_dynticks_curr_cpu_in_eqs(void)
297+
static bool rcu_dynticks_curr_cpu_in_eqs(void)
298298
{
299299
struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
300300

@@ -305,7 +305,7 @@ bool rcu_dynticks_curr_cpu_in_eqs(void)
305305
* Snapshot the ->dynticks counter with full ordering so as to allow
306306
* stable comparison of this counter with past and future snapshots.
307307
*/
308-
int rcu_dynticks_snap(struct rcu_data *rdp)
308+
static int rcu_dynticks_snap(struct rcu_data *rdp)
309309
{
310310
int snap = atomic_add_return(0, &rdp->dynticks);
311311

kernel/rcu/tree.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ static const char *tp_rcu_varname __used __tracepoint_string = rcu_name;
403403
#define RCU_NAME rcu_name
404404
#endif /* #else #ifdef CONFIG_TRACING */
405405

406-
int rcu_dynticks_snap(struct rcu_data *rdp);
407-
408406
/* Forward declarations for tree_plugin.h */
409407
static void rcu_bootup_announce(void);
410408
static void rcu_qs(void);

0 commit comments

Comments
 (0)