linux/drivers/usb/core
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
..
buffer.c usb: separate out sysdev pointer from usb_bus 2017-03-23 08:20:21 +01:00
config.c USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor() 2017-10-18 19:11:52 +02:00
devices.c usb: fix some references for /proc/bus/usb 2017-04-18 16:54:19 +02:00
devio.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
driver.c usb: hub: Do not attempt to autosuspend disconnected devices 2017-03-23 08:13:22 +01:00
endpoint.c usb: patches for v4.10 merge window 2016-11-18 16:02:15 +01:00
file.c USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously 2017-03-29 11:55:25 +02:00
generic.c USB: core: add missing license information to some files 2016-10-29 12:51:56 -04:00
hcd-pci.c USB / PCI / PM: Allow the PCI core to do the resume cleanup 2017-06-15 00:55:43 +02:00
hcd.c Merge 4.13-rc5 into usb-next 2017-08-14 14:50:58 -07:00
hub.c usb: hub: Allow reset retry for USB2 devices on connect bounce 2017-10-19 09:49:11 +02:00
hub.h usb: Support USB 3.1 extended port status request 2016-01-24 20:16:52 -08:00
Kconfig docs-rst: fix usb cross-references 2017-04-11 14:41:29 -06:00
ledtrig-usbport.c usb: core: usbport: fix "BUG: key not in .data" when lockdep is enabled 2017-08-29 08:27:25 +02:00
Makefile usb: add CONFIG_USB_PCI for system have both PCI HW and non-PCI based USB HW 2017-03-17 13:16:56 +09:00
message.c USB: core: harden cdc_parse_cdc_header 2017-09-21 17:01:38 +02:00
notify.c USB: core: add missing license information to some files 2016-10-29 12:51:56 -04:00
of.c USB: of: document reference taken by child-lookup helper 2017-06-13 11:07:32 +02:00
otg_whitelist.h usb: core: use IS_ENABLED() instead of checking for built-in or module 2016-09-02 14:36:33 +02:00
port.c Revert "USB / PM: Allow USB devices to remain runtime-suspended when sleeping" 2016-05-02 08:44:31 -07:00
quirks.c usb: quirks: add quirk for WORLDE MINI MIDI keyboard 2017-10-17 12:25:41 +02:00
sysfs.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
urb.c USB: core: replace %p with %pK 2017-05-17 11:27:41 +02:00
usb-acpi.c usb: optimize acpi companion search for usb port devices 2017-06-03 18:02:58 +09:00
usb.c USB: of: fix root-hub device-tree node handling 2017-06-13 11:07:32 +02:00
usb.h USB: core: add missing license information to some files 2016-10-29 12:51:56 -04:00