diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-08-11 12:50:22 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-08-18 16:36:13 +0300 |
commit | 112dc0c8069e5554e0ad29c58228f1e6ca49e13d (patch) | |
tree | 8106dcf22bc8e875160dd41e744ce9ac083888d7 /README | |
parent | f17b3ea3d2df7c9bf3ce1dbd65b5fd7061f8e787 (diff) | |
download | linux-112dc0c8069e5554e0ad29c58228f1e6ca49e13d.tar.xz |
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 <paulmck@linux.vnet.ibm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 331b6d8c7afc ("locking/barriers: Validate lockless_dereference() is used on a pointer type")
Link: http://lkml.kernel.org/r/1470909022-687-2-git-send-email-johannes@sipsolutions.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions