Re: [PATCH] rcu: add declarations of undeclared items

From: Ben Dooks
Date: Mon Oct 14 2019 - 03:17:17 EST




On 2019-10-12 05:44, Paul E. McKenney wrote:
On Fri, Oct 11, 2019 at 06:08:24PM +0100, Ben Dooks wrote:
The rcu_state, rcu_rnp_online_cpus and rcu_dynticks_curr_cpu_in_eqs
do not have declarations in a header. Add these to remove the
following sparse warnings:

kernel/rcu/tree.c:87:18: warning: symbol 'rcu_state' was not declared. Should it be static?
kernel/rcu/tree.c:191:15: warning: symbol 'rcu_rnp_online_cpus' was not declared. Should it be static?
kernel/rcu/tree.c:297:6: warning: symbol 'rcu_dynticks_curr_cpu_in_eqs' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx>

Good catch!

However, these guys (plus one more) are actually used only in the
kernel/rcu/tree.o translation unit, so they can be marked static.
I made this change as shown below with your Reported-by.

Seem reasonable?

yes, thanks.