| From 547161efca2c19b5fca1a02e8716dd0a95c07e08 Mon Sep 17 00:00:00 2001 |
| From: Felipe Balbi <felipe.balbi@linux.intel.com> |
| Date: Mon, 23 Jan 2017 14:20:14 +0200 |
| Subject: [PATCH 201/255] usb: host: xhci: unconditionally call |
| xhci_unmap_td_bounce_buffer() |
| |
| xhci_unmap_td_bounce_buffer() already checks for a valid td->bounce_seg |
| and bails out early if that's invalid. There's no need to check for this |
| twice. |
| |
| Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> |
| Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| (cherry picked from commit a60f2f2ffabe14a559510dcf347bef9a7a312516) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/usb/host/xhci-ring.c | 9 +++------ |
| 1 file changed, 3 insertions(+), 6 deletions(-) |
| |
| --- a/drivers/usb/host/xhci-ring.c |
| +++ b/drivers/usb/host/xhci-ring.c |
| @@ -793,8 +793,7 @@ remove_finished_td: |
| * just overwrite it (because the URB has been unlinked). |
| */ |
| ep_ring = xhci_urb_to_transfer_ring(xhci, cur_td->urb); |
| - if (ep_ring && cur_td->bounce_seg) |
| - xhci_unmap_td_bounce_buffer(xhci, ep_ring, cur_td); |
| + xhci_unmap_td_bounce_buffer(xhci, ep_ring, cur_td); |
| inc_td_cnt(cur_td->urb); |
| if (last_td_in_urb(cur_td)) |
| xhci_giveback_urb_in_irq(xhci, cur_td, 0); |
| @@ -820,8 +819,7 @@ static void xhci_kill_ring_urbs(struct x |
| if (!list_empty(&cur_td->cancelled_td_list)) |
| list_del_init(&cur_td->cancelled_td_list); |
| |
| - if (cur_td->bounce_seg) |
| - xhci_unmap_td_bounce_buffer(xhci, ring, cur_td); |
| + xhci_unmap_td_bounce_buffer(xhci, ring, cur_td); |
| |
| inc_td_cnt(cur_td->urb); |
| if (last_td_in_urb(cur_td)) |
| @@ -1836,8 +1834,7 @@ static int xhci_td_cleanup(struct xhci_h |
| urb_priv = urb->hcpriv; |
| |
| /* if a bounce buffer was used to align this td then unmap it */ |
| - if (td->bounce_seg) |
| - xhci_unmap_td_bounce_buffer(xhci, ep_ring, td); |
| + xhci_unmap_td_bounce_buffer(xhci, ep_ring, td); |
| |
| /* Do one last check of the actual transfer length. |
| * If the host controller said we transferred more data than the buffer |