]> Git Repo - linux.git/commit
locking/barriers: Suppress sparse warnings in lockless_dereference()
authorJohannes Berg <[email protected]>
Thu, 11 Aug 2016 09:50:22 +0000 (11:50 +0200)
committerIngo Molnar <[email protected]>
Thu, 18 Aug 2016 13:36:13 +0000 (15:36 +0200)
commit112dc0c8069e5554e0ad29c58228f1e6ca49e13d
tree8106dcf22bc8e875160dd41e744ce9ac083888d7
parentf17b3ea3d2df7c9bf3ce1dbd65b5fd7061f8e787
locking/barriers: Suppress sparse warnings in lockless_dereference()

After Peter's commit:

  331b6d8c7afc ("locking/barriers: Validate lockless_dereference() is used on a pointer type")

... we get a lot of sparse warnings (one for every rcu_dereference, and more)
since the expression here is assigning to the wrong address space.

Instead of validating that 'p' is a pointer this way, instead make
it fail compilation when it's not by using sizeof(*(p)). This will
not cause any sparse warnings (tested, likely since the address
space is irrelevant for sizeof), and will fail compilation when
'p' isn't a pointer type.

Tested-by: Paul E. McKenney <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: 331b6d8c7afc ("locking/barriers: Validate lockless_dereference() is used on a pointer type")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/compiler.h
This page took 0.058379 seconds and 4 git commands to generate.