Re: [RFC/PATCH 38/45] usb: gadget: udc: net2272: remove unnecessary & operation

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

 



On Wed, Sep 28, 2016 at 04:05:47PM +0300, Felipe Balbi wrote:
> Now that usb_endpoint_maxp() only returns the lowest
> 11 bits from wMaxPacketSize, we can remove the &
> operation from this driver.
> 
> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/gadget/udc/net2272.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
> index 7c6113432093..078c91d546e0 100644
> --- a/drivers/usb/gadget/udc/net2272.c
> +++ b/drivers/usb/gadget/udc/net2272.c
> @@ -202,10 +202,10 @@ net2272_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
>  	if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)
>  		return -ESHUTDOWN;
>  
> -	max = usb_endpoint_maxp(desc) & 0x1fff;
> +	max = usb_endpoint_maxp(desc);

The mask is 0x1fff, which keeps bit 11 & 12.

>  
>  	spin_lock_irqsave(&dev->lock, flags);
> -	_ep->maxpacket = max & 0x7fff;
> +	_ep->maxpacket = max;

Here it masks out bit 11 & 12.

Regards,
-Bin.

>  	ep->desc = desc;
>  
>  	/* net2272_ep_reset() has already been called */
> -- 
> 2.10.0.440.g21f862b
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux