orinoco_usb: use USB API functions rather than constants

This patch introduces the use of the functions
usb_endpoint_is_bulk_in(epd) and usb_endpoint_is_bulk_out(epd).

The semantic patch that makes these changes is as follows:

@@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_BULK\|2\))
+ usb_endpoint_xfer_bulk(epd)

@@ struct usb_endpoint_descriptor *epd; @@

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

@@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_OUT\|0\))
+ usb_endpoint_dir_out(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd))
+ usb_endpoint_is_bulk_in(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd))
+ usb_endpoint_is_bulk_out(epd)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Himangi Saraogi 2014-08-15 21:53:24 +05:30 committed by John W. Linville
parent b9395df96a
commit 7bb75da171
1 changed files with 2 additions and 8 deletions

View File

@ -1605,10 +1605,7 @@ static int ezusb_probe(struct usb_interface *interface,
for (i = 0; i < iface_desc->bNumEndpoints; ++i) { for (i = 0; i < iface_desc->bNumEndpoints; ++i) {
ep = &interface->altsetting[0].endpoint[i].desc; ep = &interface->altsetting[0].endpoint[i].desc;
if (((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) if (usb_endpoint_is_bulk_in(ep)) {
== USB_DIR_IN) &&
((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk in endpoint */ /* we found a bulk in endpoint */
if (upriv->read_urb != NULL) { if (upriv->read_urb != NULL) {
pr_warning("Found a second bulk in ep, ignored"); pr_warning("Found a second bulk in ep, ignored");
@ -1636,10 +1633,7 @@ static int ezusb_probe(struct usb_interface *interface,
} }
} }
if (((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) if (usb_endpoint_is_bulk_out(ep)) {
== USB_DIR_OUT) &&
((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk out endpoint */ /* we found a bulk out endpoint */
if (upriv->bap_buf != NULL) { if (upriv->bap_buf != NULL) {
pr_warning("Found a second bulk out ep, ignored"); pr_warning("Found a second bulk out ep, ignored");