android_kernel_xiaomi_sdm845/drivers/usb/storage
Julia Lawall 2e0fe70968 USB: drivers: use USB API functions rather than constants
This set of patches introduces calls to the following set of functions:

usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)

In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:

USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC

An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r1@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)

@r5@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@inc@
@@

#include <linux/usb.h>

@depends on !inc && (r1||r5)@
@@

+ #include <linux/usb.h>
  #include <linux/usb/...>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-24 16:20:28 -07:00
..
alauda.c USB storage: sg chaining support 2007-10-16 11:20:59 +02:00
alauda.h [PATCH] USB Storage: add alauda support 2006-01-04 13:51:42 -08:00
cypress_atacb.c [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer 2008-05-02 10:18:22 -05:00
cypress_atacb.h USB: mass storage: emulation of sat scsi_pass_thru with ATACB 2008-04-24 21:16:42 -07:00
datafab.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
datafab.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
debug.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
debug.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
freecom.c remove unnecessary <linux/hdreg.h> includes 2008-08-05 18:16:58 +02:00
freecom.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
initializers.c USB: support Huawei data card product IDs 2008-10-22 10:05:28 -07:00
initializers.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
isd200.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
isd200.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
jumpshot.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
jumpshot.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
karma.c USB Storage: add rio karma eject support 2006-09-27 11:58:54 -07:00
karma.h USB Storage: add rio karma eject support 2006-09-27 11:58:54 -07:00
Kconfig USB: usb-storage: merge DPCM support into SDDR09 2009-01-07 10:00:06 -08:00
libusual.c USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00
Makefile USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
onetouch.c USB: remove err() macro from more usb drivers 2008-10-17 14:41:14 -07:00
onetouch.h [PATCH] USB Storage: add support for Maxtor One-Touch button 2005-09-08 16:22:55 -07:00
option_ms.c USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
option_ms.h USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
protocol.c USB: usb-storage: merge ATAPI and QIC-157 protocol routines 2009-01-07 09:59:57 -08:00
protocol.h USB: usb-storage: merge ATAPI and QIC-157 protocol routines 2009-01-07 09:59:57 -08:00
scsiglue.c USB: usb-storage: increase max_sectors for tape drives 2009-03-24 16:20:26 -07:00
scsiglue.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sddr09.c USB: usb-storage: merge DPCM support into SDDR09 2009-01-07 10:00:06 -08:00
sddr09.h USB: usb-storage: merge DPCM support into SDDR09 2009-01-07 10:00:06 -08:00
sddr55.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sddr55.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
shuttle_usbat.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
shuttle_usbat.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sierra_ms.c USB Storage Sierra: TRU-Install feature update 2008-08-13 17:32:51 -07:00
sierra_ms.h USB Storage Sierra: TRU-Install feature update 2008-08-13 17:32:51 -07:00
transport.c USB: usb-storage: remove WARN from last-sector hacks 2009-02-09 11:19:47 -08:00
transport.h USB: usb-storage: merge CB and CBI transport routines 2009-01-07 09:59:57 -08:00
unusual_devs.h USB: storage: Unusual USB device Prolific 2507 variation added 2009-03-17 14:01:29 -07:00
usb.c USB: drivers: use USB API functions rather than constants 2009-03-24 16:20:28 -07:00
usb.h USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00