Staging: most: Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddre...
authorSandhya Bankar <bankarsandhya512@gmail.com>
Sun, 6 Mar 2016 10:20:35 +0000 (15:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2016 03:26:05 +0000 (19:26 -0800)
Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN) to check if the endpoint has IN direction.
This correction is based on following semantic patch,

@@
struct usb_endpoint_descriptor *endpoint;
expression E;
@@

(
- endpoint->bEndpointAddress & USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
|
- endpoint->bEndpointAddress == USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
|
- (endpoint->bEndpointAddress & E) == USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
)

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/hdm-usb/hdm_usb.c

index 9d5555d..78031ab 100644 (file)
@@ -1299,7 +1299,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
                tmp_cap->num_buffers_streaming = BUF_CHAIN_SIZE;
                tmp_cap->data_type = MOST_CH_CONTROL | MOST_CH_ASYNC |
                                     MOST_CH_ISOC_AVP | MOST_CH_SYNC;
-               if (ep_desc->bEndpointAddress & USB_DIR_IN)
+               if (usb_endpoint_dir_in(ep_desc))
                        tmp_cap->direction = MOST_CH_RX;
                else
                        tmp_cap->direction = MOST_CH_TX;