diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-20 15:46:31 -0800 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-06-28 13:39:28 -0400 |
commit | d24b9b8d95f0df8c3b1430ff76396fd705cc0140 (patch) | |
tree | 487908ca48047e6744914e62c1ce19855871fb9b /net/rfkill/Makefile | |
parent | ac54513c498163cb043c2564d8062596a788f4a2 (diff) |
kernel: make READ_ONCE() valid on const arguments
[ Upstream commit dd36929720f40f17685e841ae0d4c581c165ea60 ]
The use of READ_ONCE() causes lots of warnings witht he pending paravirt
spinlock fixes, because those ends up having passing a member to a
'const' structure to READ_ONCE().
There should certainly be nothing wrong with using READ_ONCE() with a
const source, but the helper function __read_once_size() would cause
warnings because it would drop the 'const' qualifier, but also because
the destination would be marked 'const' too due to the use of 'typeof'.
Use a union of types in READ_ONCE() to avoid this issue.
Also make sure to use parenthesis around the macro arguments to avoid
possible operator precedence issues.
Tested-by: Ingo Molnar <mingo@kernel.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'net/rfkill/Makefile')
0 files changed, 0 insertions, 0 deletions