summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-01-26 16:03:54 +0100
committerPaul E. McKenney <paulmck@kernel.org>2022-04-12 00:52:29 +0200
commitdb8f1471c61336477e2bf74dcb00e67d650e6dea (patch)
treee869206b34cbcd123192f957dca4f886a2f5ae19 /kernel/rcu
parentsrcu: Add boot-time control over srcu_node array allocation (diff)
downloadlinux-db8f1471c61336477e2bf74dcb00e67d650e6dea.tar.xz
linux-db8f1471c61336477e2bf74dcb00e67d650e6dea.zip
srcu: Use export for srcu_struct defined by DEFINE_STATIC_SRCU()
If an srcu_struct structure defined by tree SRCU's DEFINE_STATIC_SRCU() is used by a module, sparse will give the following diagnostic: sparse: symbol '__srcu_struct_nodes_srcu' was not declared. Should it be static? The problem is that a within-module DEFINE_STATIC_SRCU() must define a non-static srcu_struct because it is exported by referencing it in a special '__section("___srcu_struct_ptrs")'. This reference is needed so that module load and unloading can invoke init_srcu_struct() and cleanup_srcu_struct(), respectively. Unfortunately, sparse is unaware of '__section("___srcu_struct_ptrs")', resulting in the above false-positive diagnostic. To avoid this false positive, this commit therefore creates a prototype of the srcu_struct with an "extern" keyword. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu')
0 files changed, 0 insertions, 0 deletions