Mark Rutland
6aa7de0591
locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
...
Please do not apply this to mainline directly, instead please re-run the
coccinelle script shown below and apply its output.
For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
preference to ACCESS_ONCE(), and new code is expected to use one of the
former. So far, there's been no reason to change most existing uses of
ACCESS_ONCE(), as these aren't harmful, and changing them results in
churn.
However, for some features, the read/write distinction is critical to
correct operation. To distinguish these cases, separate read/write
accessors must be used. This patch migrates (most) remaining
ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
coccinelle script:
----
// Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
// WRITE_ONCE()
// $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch
virtual patch
@ depends on patch @
expression E1, E2;
@@
- ACCESS_ONCE(E1) = E2
+ WRITE_ONCE(E1, E2)
@ depends on patch @
expression E;
@@
- ACCESS_ONCE(E)
+ READ_ONCE(E)
----
Signed-off-by: Mark Rutland <mark.rutland@arm.com >
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: davem@davemloft.net
Cc: linux-arch@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: shuah@kernel.org
Cc: snitzer@redhat.com
Cc: thor.thayer@linux.intel.com
Cc: tj@kernel.org
Cc: viro@zeniv.linux.org.uk
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2017-10-25 11:01:08 +02:00
..
2009-08-03 09:05:00 +01:00
2008-07-27 23:00:59 +02:00
2009-12-12 13:08:14 +01:00
2017-06-19 11:13:05 -07:00
2008-12-09 00:50:13 -08:00
2012-05-27 23:52:43 -07:00
2017-10-25 11:01:08 +02:00
2016-06-16 10:48:30 +02:00
2016-06-16 10:48:32 +02:00
2014-05-18 19:01:29 -07:00
2014-05-18 19:01:29 -07:00
2014-04-29 01:12:26 -04:00
2012-10-28 13:04:47 -07:00
2016-01-12 20:46:49 +02:00
2016-01-12 20:46:57 +02:00
2012-03-28 18:30:03 +01:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2014-06-19 07:50:07 -10:00
2014-06-19 07:50:07 -10:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2014-05-18 19:01:29 -07:00
2008-09-02 00:49:38 -07:00
2012-05-19 21:15:37 -07:00
2014-05-18 19:01:29 -07:00
2015-02-05 13:35:30 -08:00
2012-05-20 13:33:36 -07:00
2012-05-13 20:49:31 -07:00
2008-07-27 23:00:59 +02:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2015-05-13 10:55:42 +02:00
2017-05-25 12:06:51 -07:00
2012-03-28 18:30:03 +01:00
2016-03-20 21:28:58 -07:00
2016-03-22 15:36:02 -07:00
2012-05-11 21:29:17 -07:00
2012-05-12 00:23:23 -07:00
2014-08-26 13:45:55 -04:00
2016-10-24 11:04:17 -07:00
2014-04-29 01:12:25 -04:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2017-06-28 06:54:39 -07:00
2012-05-13 13:57:05 -07:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2013-02-26 02:46:08 -05:00
2016-10-05 18:38:40 -04:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2016-10-05 18:38:40 -04:00
2010-08-16 12:26:09 -07:00
2012-10-09 09:47:43 +01:00
2008-08-31 20:56:15 -07:00
2014-05-18 19:01:29 -07:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2016-08-24 12:15:13 +02:00
2008-07-27 23:00:59 +02:00
2017-08-25 22:49:59 +02:00
2008-07-27 23:00:59 +02:00
2013-11-13 20:21:46 +01:00
2013-11-13 20:21:46 +01:00
2008-07-27 23:00:59 +02:00
2016-05-20 17:55:41 -07:00
2016-05-29 18:55:54 -07:00
2008-07-27 23:00:59 +02:00
2013-03-20 11:06:54 -07:00
2014-05-18 19:01:29 -07:00
2017-08-15 21:48:07 -07:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2017-08-09 22:15:10 -07:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2016-06-04 15:43:15 +02:00
2015-06-07 15:28:57 +02:00
2014-05-18 19:01:26 -07:00
2014-11-19 10:19:45 +01:00
2012-10-09 09:47:43 +01:00
2014-05-18 19:01:26 -07:00
2016-11-18 11:16:59 -08:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2016-10-07 18:46:30 -07:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2011-07-06 08:00:29 -07:00
2008-07-27 23:00:59 +02:00
2015-08-03 11:34:15 +02:00
2017-07-11 21:33:52 +09:00
2008-11-01 21:44:01 -07:00
2016-12-11 18:01:51 -08:00
2008-07-27 23:00:59 +02:00
2016-05-20 17:55:41 -07:00
2009-06-16 19:47:51 -07:00
2017-02-27 18:43:45 -08:00
2017-06-10 14:10:54 -07:00
2013-06-19 02:10:29 -07:00
2014-05-18 19:01:29 -07:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2012-05-12 00:35:45 -07:00
2012-05-15 10:22:00 -07:00
2008-07-27 23:00:59 +02:00
2008-08-29 14:16:48 -07:00
2014-05-18 19:01:27 -07:00
2017-06-25 13:43:13 -07:00
2008-08-24 22:08:34 -07:00
2012-10-09 09:47:43 +01:00
2011-03-16 18:19:08 -07:00
2017-06-06 13:45:28 -07:00
2012-07-26 16:46:16 -07:00
2017-07-18 11:25:52 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2011-06-27 14:13:09 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2017-07-12 16:26:02 -07:00
2012-03-28 18:30:03 +01:00
2016-03-20 21:28:58 -07:00
2016-03-20 21:28:58 -07:00
2014-05-18 19:01:29 -07:00
2014-10-24 09:52:49 -07:00
2008-07-27 23:00:59 +02:00
2017-08-10 15:03:57 -07:00
2017-08-15 21:48:07 -07:00
2014-05-02 01:30:20 -04:00
2014-10-20 16:20:14 +02:00
2008-07-27 23:00:59 +02:00
2015-06-08 07:56:43 -05:00
2017-04-18 13:02:26 -05:00
2016-03-07 10:40:02 -06:00
2014-05-18 19:01:29 -07:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2009-06-16 04:56:23 -07:00
2008-07-27 23:00:59 +02:00
2010-11-26 15:14:56 +01:00
2016-05-20 17:55:42 -07:00
2016-06-24 17:23:52 -07:00
2008-07-27 23:00:59 +02:00
2017-05-17 12:07:46 -07:00
2017-08-15 21:48:07 -07:00
2008-07-27 23:00:59 +02:00
2015-02-10 14:30:33 -08:00
2017-06-06 13:45:29 -07:00
2017-06-28 16:13:57 -07:00
2017-06-28 16:13:57 -07:00
2016-01-12 20:46:49 +02:00
2014-05-18 19:01:29 -07:00
2012-10-09 09:47:43 +01:00
2017-10-24 13:17:32 +02:00
2017-05-25 12:06:51 -07:00
2017-05-25 12:06:52 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2015-04-17 09:04:10 -04:00
2012-05-27 23:52:43 -07:00
2017-06-12 15:44:01 -07:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:28 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2012-05-12 00:23:23 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2016-03-20 21:28:58 -07:00
2013-02-03 15:09:22 -05:00
2014-05-18 19:01:29 -07:00
2017-08-09 22:15:10 -07:00
2008-07-27 23:00:59 +02:00
2013-11-12 15:22:34 -08:00
2017-10-10 11:50:19 +02:00
2017-10-10 11:50:19 +02:00
2017-05-25 12:06:52 -07:00
2008-07-27 23:00:59 +02:00
2017-08-04 11:08:53 -07:00
2014-05-18 19:01:29 -07:00
2015-03-01 21:33:58 -08:00
2016-08-07 23:55:48 -04:00
2016-08-07 23:55:48 -04:00
2016-08-07 23:55:48 -04:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2017-02-27 18:43:46 -08:00
2014-05-18 19:01:29 -07:00
2012-03-28 18:30:03 +01:00
2016-03-22 15:36:02 -07:00
2014-05-18 19:01:29 -07:00
2012-10-09 09:47:43 +01:00
2012-10-09 09:47:43 +01:00
2015-04-12 21:03:31 +02:00
2016-12-11 18:01:51 -08:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2017-06-12 15:44:03 -07:00
2008-07-27 23:00:59 +02:00
2012-04-15 10:28:50 -07:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00
2012-05-13 20:49:31 -07:00
2017-02-23 08:30:28 -08:00
2008-07-27 23:00:59 +02:00
2008-07-27 23:00:59 +02:00
2017-02-23 08:21:45 -08:00
2008-07-27 23:00:59 +02:00
2017-09-09 20:20:11 -07:00
2012-10-09 09:47:43 +01:00
2017-08-15 21:48:07 -07:00
2008-07-27 23:00:59 +02:00
2016-12-11 18:01:51 -08:00
2008-07-27 23:00:59 +02:00
2017-05-15 23:40:22 -04:00
2017-07-15 11:17:52 -07:00
2017-03-28 16:43:25 -04:00
2008-07-27 23:00:59 +02:00
2014-06-04 16:54:14 -07:00
2008-07-27 23:00:59 +02:00
2017-02-23 08:22:28 -08:00
2008-07-27 23:00:59 +02:00
2012-07-26 16:46:16 -07:00
2017-09-08 18:26:48 -07:00
2008-07-27 23:00:59 +02:00
2017-08-15 21:33:51 -07:00
2015-08-06 19:13:25 -07:00
2012-05-14 13:31:38 -07:00
2008-07-27 23:00:59 +02:00
2014-05-18 19:01:29 -07:00
2008-07-27 23:00:59 +02:00