diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2019-04-15 19:35:46 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2019-05-03 08:13:47 +0200 |
commit | de497f634609aa1710fef4b6d833a037120369cc (patch) | |
tree | bc4e821bd042d47dd73747202c7af475f7fdfc45 /drivers/usb/gadget | |
parent | USB: UDC: net2280: Remove redundant "if" condition (diff) | |
download | linux-de497f634609aa1710fef4b6d833a037120369cc.tar.xz linux-de497f634609aa1710fef4b6d833a037120369cc.zip |
USB: UDC: net22{80,72}: remove mistaken test of req->zero
The net2280 UDC driver (and also net2272, probably via copy-and-paste)
incorrectly checks the req->zero flag during OUT transfers, after
copying data from the UDC's FIFO into memory. This makes no sense at
all; the "zero" flag indicates that an extra zero-length packet should
be appended to an IN transfer if the length is an even multiple of the
maxpacket size. It has nothing to do with OUT transfers.
In practice this doesn't cause any problems because gadget drivers
never set req->zero for OUT transfers anyway. Still, it is an error
and unnecessary code, so this patch removes the check.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/udc/net2272.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/net2280.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index c2011cd7df8c..564aeee1a1fe 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c @@ -573,8 +573,7 @@ net2272_read_fifo(struct net2272_ep *ep, struct net2272_request *req) /* completion */ if (unlikely(cleanup || is_short || - ((req->req.actual == req->req.length) - && !req->req.zero))) { + req->req.actual == req->req.length)) { if (cleanup) { net2272_out_flush(ep); diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index b17473a00b43..b6bbe2e448ba 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -789,8 +789,7 @@ static int read_fifo(struct net2280_ep *ep, struct net2280_request *req) (void) readl(&ep->regs->ep_rsp); } - return is_short || ((req->req.actual == req->req.length) && - !req->req.zero); + return is_short || req->req.actual == req->req.length; } /* fill out dma descriptor to match a given request */ |