Re: [PATCH v2 2/2] Staging: ft1000: ft1000-usb: use USB API functions rather than constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 05, 2015 at 03:18:04AM +0530, Shraddha Barke wrote:
> This patch introduces the use of the function usb_endpoint_type.
> 
> The Coccinelle semantic patch that makes these changes is as follows:
> 
> @@ struct usb_endpoint_descriptor *epd; @@
> 
> - (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
> + usb_endpoint_type(epd)
> 
> Signed-off-by: Shraddha Barke <shraddha.6596@xxxxxxxxx>
> ---
> Changes in v2:
>   -Fix subject line
> 
>  drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
> index fd255c6..abdb0ab 100644
> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
> @@ -112,7 +112,7 @@ static int ft1000_probe(struct usb_interface *interface,
>  		pr_debug("bEndpointAddress=%x, bmAttributes=%x\n",
>  			 endpoint->bEndpointAddress, endpoint->bmAttributes);
>  		if ((endpoint->bEndpointAddress & USB_DIR_IN)
> -		    && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
> +		    && (usb_endpoint_type(endpoint) ==
>  			USB_ENDPOINT_XFER_BULK)) {

All of that mess should be replaced with usb_endpoint_is_bulk_in().

>  			ft1000dev->bulk_in_endpointAddr =
>  				endpoint->bEndpointAddress;
> @@ -120,7 +120,7 @@ static int ft1000_probe(struct usb_interface *interface,
>  		}
>  
>  		if (!(endpoint->bEndpointAddress & USB_DIR_IN)
> -		    && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
> +		    && (usb_endpoint_type(endpoint) ==
>  			USB_ENDPOINT_XFER_BULK)) {

Same here.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux