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
..
2017-04-05 21:58:37 +08:00
2017-07-18 11:38:01 +02:00
2017-09-26 09:43:45 +02:00
2017-09-26 09:43:36 +02:00
2017-06-05 09:59:35 +02:00
2017-09-29 12:24:28 -07:00
2017-03-02 08:42:37 +01:00
2017-07-30 12:09:12 +02:00
2017-10-09 13:35:17 +02:00
2017-10-09 13:35:17 +02:00
2017-05-21 21:55:13 +02:00
2017-06-22 18:21:22 +02:00
2016-06-08 12:41:20 -07:00
2016-06-08 15:01:02 +02:00
2016-06-08 12:41:20 -07:00
2016-12-24 11:46:01 -08:00
2017-09-29 19:39:44 +02:00
2017-06-28 18:55:55 +02:00
2017-06-28 18:55:55 +02:00
2017-06-28 18:55:55 +02:00
2016-01-29 09:40:10 +01:00
2016-07-21 10:11:57 +02:00
2016-12-29 11:03:15 -08:00
2016-05-07 07:38:39 +02:00
2017-07-20 12:31:04 +02:00
2016-05-20 09:07:40 +02:00
2017-08-31 15:05:10 -07:00
2016-07-15 10:26:30 +02:00
2016-12-24 11:46:01 -08:00
2017-03-11 14:47:28 +01:00
2017-07-18 11:38:06 +02:00
2017-06-28 18:55:55 +02:00
2017-05-27 15:38:06 -04:00
2016-07-27 11:35:37 -07:00
2016-12-09 21:23:20 +01:00
2017-09-08 15:18:36 -07:00
2017-08-29 12:07:25 +02:00
2017-09-13 10:55:15 +02:00
2017-01-24 12:23:35 -05:00
2017-07-05 10:52:57 +02:00
2017-01-14 11:31:50 +01:00
2017-07-18 11:38:03 +02:00
2017-07-18 11:37:58 +02:00
2017-07-12 16:26:04 -07:00
2017-09-04 12:21:28 -07:00
2017-08-29 11:42:29 +02:00
2016-08-07 23:47:15 -04:00
2017-06-12 21:17:48 +02:00
2017-07-18 11:38:00 +02:00
2016-12-18 09:25:38 +01:00
2016-01-19 12:59:07 +01:00
2016-08-24 12:15:15 +02:00
2017-08-25 22:49:59 +02:00
2017-01-28 22:55:22 +01:00
2017-07-26 18:57:45 +02:00
2017-07-06 16:24:33 -07:00
2017-08-29 11:42:28 +02:00
2017-08-11 15:50:21 +02:00
2016-02-23 07:37:23 +01:00
2016-07-21 09:37:11 -03:00
2017-07-18 11:38:04 +02:00
2016-07-21 09:37:11 -03:00
2017-04-28 21:51:28 +03:00
2016-01-19 15:49:36 -08:00
2017-08-14 11:47:47 +02:00
2017-04-13 10:16:04 -07:00
2016-05-05 13:58:55 -07:00
2017-04-14 21:22:38 +02:00
2017-01-09 23:13:36 +01:00
2017-10-20 09:48:00 +02:00
2017-06-28 06:54:46 -07:00
2017-03-02 15:46:25 +01:00
2016-03-08 12:26:41 +01:00
2017-06-22 18:21:11 +02:00
2017-07-26 18:57:45 +02:00
2017-08-29 11:42:30 +02:00
2017-08-29 11:42:21 +02:00
2016-10-07 18:46:30 -07:00
2017-04-04 08:22:33 +02:00
2016-08-10 16:10:06 +02:00
2017-02-01 09:14:07 +01:00
2016-10-25 18:40:37 +02:00
2017-07-30 12:09:12 +02:00
2016-04-29 11:56:40 +02:00
2017-07-20 11:34:47 -07:00
2017-08-24 18:09:15 +02:00
2017-09-13 18:29:06 +02:00
2017-03-28 14:08:02 +02:00
2017-10-04 18:28:53 +02:00
2017-02-08 17:16:19 +01:00
2016-05-05 08:37:31 +02:00
2016-07-14 15:07:00 +02:00
2016-06-08 12:41:20 -07:00
2016-06-04 00:20:00 +02:00
2017-10-05 14:23:06 +02:00
2017-09-07 11:53:11 +02:00
2017-01-23 10:02:50 +01:00
2017-01-09 23:11:14 +01:00
2017-01-31 08:38:17 +01:00
2017-10-24 13:17:33 +02:00
2017-07-05 10:52:56 +02:00
2017-07-26 13:18:20 +02:00
2017-09-11 08:16:37 +02:00
2017-07-21 10:05:18 +02:00
2017-10-10 12:53:00 +02:00
2017-07-18 11:37:59 +02:00
2017-01-23 10:02:45 +01:00
2016-03-29 12:23:26 +02:00
2017-03-02 08:42:26 +01:00
2017-07-26 13:18:20 +02:00
2017-07-26 13:18:20 +02:00
2016-07-27 14:59:59 +02:00
2017-04-04 08:22:33 +02:00
2017-08-17 10:30:49 +02:00
2017-07-18 11:38:00 +02:00
2016-05-07 07:38:39 +02:00
2017-09-23 15:06:20 +02:00
2017-09-13 10:55:15 +02:00
2017-07-05 09:01:24 +02:00
2017-01-28 09:31:14 +01:00
2017-06-28 22:32:55 +02:00
2016-11-18 12:07:57 +01:00
2016-04-28 10:32:42 +02:00
2017-04-04 08:22:34 +02:00
2017-03-21 08:21:17 +01:00
2017-04-04 08:22:34 +02:00
2017-09-08 18:26:45 -07:00
2017-09-08 18:26:45 -07:00
2017-03-14 08:45:07 +01:00
2017-02-24 17:46:54 -08:00
2017-03-14 08:45:07 +01:00
2017-06-13 08:56:50 +02:00
2017-09-13 10:55:15 +02:00
2017-03-01 10:51:50 +01:00
2016-05-27 11:47:56 -07:00
2017-09-23 15:06:20 +02:00
2017-08-21 11:35:50 +02:00
2017-09-23 15:06:20 +02:00
2017-08-31 21:35:10 +02:00
2017-08-10 13:14:58 +02:00
2017-03-10 20:55:09 +01:00
2016-12-25 11:04:12 +01:00
2016-02-24 08:35:44 +01:00
2017-10-10 11:50:12 +02:00
2017-07-18 11:38:04 +02:00
2017-03-13 20:18:07 +01:00
2017-09-28 09:45:05 +02:00
2017-04-04 08:22:33 +02:00
2017-07-25 11:18:09 +02:00
2017-10-10 11:50:15 +02:00
2016-09-27 21:15:23 -04:00
2017-08-29 12:07:26 +02:00
2017-07-18 11:38:02 +02:00
2017-08-03 23:26:22 +02:00
2016-02-17 08:32:11 +01:00
2016-09-14 21:28:11 +02:00
2016-01-30 11:22:17 +01:00
2017-04-14 22:43:00 +02:00
2017-04-04 08:22:33 +02:00
2017-09-13 10:55:15 +02:00
2016-09-30 10:56:00 +02:00
2017-10-10 11:50:19 +02:00
2017-07-12 16:26:03 -07:00
2017-01-12 09:28:28 +01:00
2017-09-08 18:26:48 -07:00
2017-09-08 18:26:48 -07:00
2017-06-22 03:10:12 +02:00
2017-08-23 18:37:37 +02:00
2016-08-04 08:50:07 -04:00
2017-01-12 09:28:28 +01:00
2016-06-08 12:41:20 -07:00
2016-09-15 08:25:12 +02:00
2016-04-29 11:56:40 +02:00
2017-09-29 19:39:44 +02:00
2017-05-15 10:15:15 +02:00
2017-08-31 11:07:07 +02:00
2017-06-05 09:59:44 +02:00
2017-10-18 15:25:02 +02:00
2017-07-27 10:53:00 +02:00
2017-08-31 21:35:10 +02:00
2016-12-25 11:04:12 +01:00
2017-03-29 12:06:28 -04:00
2017-06-09 09:09:56 -07:00
2017-09-25 09:36:16 +02:00
2017-04-17 12:52:22 -04:00
2017-08-10 14:16:19 +02:00
2017-07-26 14:05:36 +02:00
2017-03-11 14:47:28 +01:00
2017-07-18 11:38:04 +02:00
2017-10-25 11:01:08 +02:00
2016-06-16 00:04:31 +02:00
2017-08-24 18:09:17 +02:00
2016-12-19 11:34:16 +01:00
2016-04-13 11:37:40 +02:00
2016-04-13 11:37:40 +02:00