summaryrefslogtreecommitdiff
path: root/include/linux/srcu.h
diff options
context:
space:
mode:
authorJoel Fernandes (Google) <joel@joelfernandes.org>2018-12-12 14:37:10 -0800
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-01-25 15:35:24 -0800
commit423a86a610cad121742ebe698ef98a3b4c87b5dd (patch)
tree9117e80180d67b87476ba360d5f19505c783ae55 /include/linux/srcu.h
parentc2d8089de7f0b849af11c271278fe6b904db5df2 (diff)
rcu: Add sparse check to rcu_assign_pointer()
The rcu_assign_pointer() function currently doesn't do any sparse checking on the assigned-to pointer. So its possible that a pointer that is not __rcu annotated is assigned with rcu_assign_pointer without sparse complaints. Because rcu_dereference() already does such checking, this commit makes rcu_assign_pointer() to do the same. The extra error could be helpful in cases where an RCU pointer is assigned with rcu_assign_pointer() but not annotated with __rcu. This doesn't generate any code in the normal case because __CHECKER__ is defined only in the context of sparse. This commit also renames rcu_dereference_sparse() to rcu_check_parse() since the checking now happens not only during derereferencing but also during assignment. Test: Introduced an rcu_assign_pointer in code and checked the output of sparse with and without this change. The change correctly causes sparse to throw an error. Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'include/linux/srcu.h')
0 files changed, 0 insertions, 0 deletions