Files
android_kernel_samsung_msm8…/include/linux
Linus Torvalds 3e81f01ff4 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.

Change-Id: I146ae2cdbba4e2f195d245722f605ca349bbb9ac
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>
2020-12-12 22:45:54 +01:00
..
…
…
…
…
…
…
…
…
…
…
…
…
2020-09-23 18:05:04 +02:00
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
2013-06-20 10:46:21 -07:00
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-02 15:14:10 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-06 10:44:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-02 15:14:10 +02:00
2020-09-23 17:37:32 +02:00
…
…
…
…
…
…
…
…
…
…
2019-08-06 10:44:15 +02:00
…
…
…
…
2013-06-14 13:34:03 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-06 12:26:30 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2020-08-08 16:42:41 +02:00
…
…
…
…
…
…
…
2019-08-02 15:14:10 +02:00
…
…
…
…
2020-08-08 16:42:41 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
…
2019-08-05 14:20:47 +02:00
2020-09-23 17:38:55 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
2019-08-06 10:41:58 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
2019-08-06 10:44:38 +02:00
…
…
…
…
…
…
…
…
…
2020-09-23 17:38:52 +02:00
…
…
…
…
…
…
…
…
…
…
…
2019-08-06 10:44:40 +02:00
…
…
2019-08-02 15:14:10 +02:00
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
2019-08-05 14:20:47 +02:00
2019-08-09 09:13:49 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
2019-08-08 12:09:23 +02:00
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
…
…
…
2019-08-02 15:14:10 +02:00
…
…
…
…
…
…
…
…
2020-09-23 17:32:10 +02:00
…
…
2019-08-05 09:13:24 +02:00
…
…
…
…
…
…
2014-01-16 18:16:12 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
2019-08-05 14:20:47 +02:00
…
…
2019-08-02 15:14:10 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2020-09-23 17:37:32 +02:00
…
…
2019-08-05 09:13:25 +02:00
2019-08-05 14:20:47 +02:00
…
…
…
…
…
2014-07-22 14:33:44 -06:00
…
…
…
…
…
…
…
…
…
…
…
…
2020-09-23 18:05:05 +02:00
…
…
…
…
2013-10-07 12:28:53 +05:30
…
2019-08-05 14:20:47 +02:00
…
…
…
…
2020-12-12 21:36:55 +01:00
…
…
…
…
2019-08-05 14:20:47 +02:00
2019-08-06 12:26:30 +02:00
…
…
…
…
…
…
…
2013-11-17 11:31:01 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2013-12-26 14:33:32 -08:00
…
…
2019-08-05 14:20:47 +02:00
…
…
…
…
2019-08-05 14:20:47 +02:00
…
…
2019-08-02 15:14:10 +02:00
2019-08-06 08:16:29 +02:00
…
…
…
…