| From fd64265d9c1d9b5d14252e1f15e7cfa9ce9c47cf Mon Sep 17 00:00:00 2001 |
| From: Mathias Nyman <mathias.nyman@linux.intel.com> |
| Date: Mon, 23 Jan 2017 14:20:25 +0200 |
| Subject: [PATCH 211/255] xhci: Rename variables related to transfer |
| descritpors |
| |
| urb_priv structure has a count on how many TDs the |
| URB contains, and how many of those TD's we have handled. |
| |
| rename: |
| length -> num_tds |
| td_cnt -> num_tds_done |
| |
| No functional changes |
| |
| Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| (cherry picked from commit 9ef7fbbb4fdfb857e606a9fd550faa8011cce5e2) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/usb/host/xhci-ring.c | 10 +++++----- |
| drivers/usb/host/xhci.c | 14 +++++++------- |
| drivers/usb/host/xhci.h | 4 ++-- |
| 3 files changed, 14 insertions(+), 14 deletions(-) |
| |
| --- a/drivers/usb/host/xhci-ring.c |
| +++ b/drivers/usb/host/xhci-ring.c |
| @@ -119,14 +119,14 @@ static bool last_td_in_urb(struct xhci_t |
| { |
| struct urb_priv *urb_priv = td->urb->hcpriv; |
| |
| - return urb_priv->td_cnt == urb_priv->length; |
| + return urb_priv->num_tds_done == urb_priv->num_tds; |
| } |
| |
| static void inc_td_cnt(struct urb *urb) |
| { |
| struct urb_priv *urb_priv = urb->hcpriv; |
| |
| - urb_priv->td_cnt++; |
| + urb_priv->num_tds_done++; |
| } |
| |
| static void trb_to_noop(union xhci_trb *trb, u32 noop_type) |
| @@ -2058,7 +2058,7 @@ static int process_isoc_td(struct xhci_h |
| ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer)); |
| trb_comp_code = GET_COMP_CODE(le32_to_cpu(event->transfer_len)); |
| urb_priv = td->urb->hcpriv; |
| - idx = urb_priv->td_cnt; |
| + idx = urb_priv->num_tds_done; |
| frame = &td->urb->iso_frame_desc[idx]; |
| requested = frame->length; |
| remaining = EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); |
| @@ -2137,7 +2137,7 @@ static int skip_isoc_td(struct xhci_hcd |
| |
| ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer)); |
| urb_priv = td->urb->hcpriv; |
| - idx = urb_priv->td_cnt; |
| + idx = urb_priv->num_tds_done; |
| frame = &td->urb->iso_frame_desc[idx]; |
| |
| /* The transfer is partly done. */ |
| @@ -3134,7 +3134,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd * |
| urb_priv = urb->hcpriv; |
| |
| /* Deal with URB_ZERO_PACKET - need one more td/trb */ |
| - if (urb->transfer_flags & URB_ZERO_PACKET && urb_priv->length > 1) |
| + if (urb->transfer_flags & URB_ZERO_PACKET && urb_priv->num_tds > 1) |
| need_zero_pkt = true; |
| |
| td = urb_priv->td[0]; |
| --- a/drivers/usb/host/xhci.c |
| +++ b/drivers/usb/host/xhci.c |
| @@ -1385,8 +1385,8 @@ int xhci_urb_enqueue(struct usb_hcd *hcd |
| buffer++; |
| } |
| |
| - urb_priv->length = num_tds; |
| - urb_priv->td_cnt = 0; |
| + urb_priv->num_tds = num_tds; |
| + urb_priv->num_tds_done = 0; |
| urb->hcpriv = urb_priv; |
| |
| trace_xhci_urb_enqueue(urb); |
| @@ -1529,8 +1529,8 @@ int xhci_urb_dequeue(struct usb_hcd *hcd |
| xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
| "HW died, freeing TD."); |
| urb_priv = urb->hcpriv; |
| - for (i = urb_priv->td_cnt; |
| - i < urb_priv->length && xhci->devs[urb->dev->slot_id]; |
| + for (i = urb_priv->num_tds_done; |
| + i < urb_priv->num_tds && xhci->devs[urb->dev->slot_id]; |
| i++) { |
| td = urb_priv->td[i]; |
| if (!list_empty(&td->td_list)) |
| @@ -1555,8 +1555,8 @@ int xhci_urb_dequeue(struct usb_hcd *hcd |
| } |
| |
| urb_priv = urb->hcpriv; |
| - i = urb_priv->td_cnt; |
| - if (i < urb_priv->length) |
| + i = urb_priv->num_tds_done; |
| + if (i < urb_priv->num_tds) |
| xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, |
| "Cancel URB %p, dev %s, ep 0x%x, " |
| "starting at offset 0x%llx", |
| @@ -1566,7 +1566,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd |
| urb_priv->td[i]->start_seg, |
| urb_priv->td[i]->first_trb)); |
| |
| - for (; i < urb_priv->length; i++) { |
| + for (; i < urb_priv->num_tds; i++) { |
| td = urb_priv->td[i]; |
| list_add_tail(&td->cancelled_td_list, &ep->cancelled_td_list); |
| } |
| --- a/drivers/usb/host/xhci.h |
| +++ b/drivers/usb/host/xhci.h |
| @@ -1608,8 +1608,8 @@ struct xhci_scratchpad { |
| }; |
| |
| struct urb_priv { |
| - int length; |
| - int td_cnt; |
| + int num_tds; |
| + int num_tds_done; |
| struct xhci_td *td[0]; |
| }; |
| |