usb: gadget: lpc32xx_udc: Remove NULL check of list_entry()
list_entry() will never return a NULL pointer, thus remove the check. Signed-off-by: Yuesong Li <liyuesong@vivo.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Link: https://lore.kernel.org/r/20240821085245.25348-1-liyuesong@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e24ed5e2f9
commit
7393bf343a
@ -1487,7 +1487,6 @@ static int udc_ep0_out_req(struct lpc32xx_udc *udc)
|
||||
req = list_entry(ep0->queue.next, struct lpc32xx_request,
|
||||
queue);
|
||||
|
||||
if (req) {
|
||||
if (req->req.length == 0) {
|
||||
/* Just dequeue request */
|
||||
done(ep0, req, 0);
|
||||
@ -1512,7 +1511,6 @@ static int udc_ep0_out_req(struct lpc32xx_udc *udc)
|
||||
udc->ep0state = WAIT_FOR_SETUP;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1962,7 +1960,7 @@ static void udc_handle_eps(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
|
||||
|
||||
/* If there isn't a request waiting, something went wrong */
|
||||
req = list_entry(ep->queue.next, struct lpc32xx_request, queue);
|
||||
if (req) {
|
||||
|
||||
done(ep, req, 0);
|
||||
|
||||
/* Start another request if ready */
|
||||
@ -1973,7 +1971,6 @@ static void udc_handle_eps(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
|
||||
udc_ep_out_req_dma(udc, ep);
|
||||
} else
|
||||
ep->req_pending = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1989,10 +1986,6 @@ static void udc_handle_dma_ep(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
|
||||
#endif
|
||||
|
||||
req = list_entry(ep->queue.next, struct lpc32xx_request, queue);
|
||||
if (!req) {
|
||||
ep_err(ep, "DMA interrupt on no req!\n");
|
||||
return;
|
||||
}
|
||||
dd = req->dd_desc_ptr;
|
||||
|
||||
/* DMA descriptor should always be retired for this call */
|
||||
|
Loading…
Reference in New Issue
Block a user