提交 e6f7caa3 编写于 作者: M Mathias Nyman 提交者: Greg Kroah-Hartman

xhci: rename size variable to num_tds

No functinal changes.
num_tds describes the number of transfer descriptor better than "size"
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a711edee
...@@ -1337,7 +1337,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) ...@@ -1337,7 +1337,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
int ret = 0; int ret = 0;
unsigned int slot_id, ep_index; unsigned int slot_id, ep_index;
struct urb_priv *urb_priv; struct urb_priv *urb_priv;
int size, i; int num_tds, i;
if (!urb || xhci_check_args(hcd, urb->dev, urb->ep, if (!urb || xhci_check_args(hcd, urb->dev, urb->ep,
true, true, __func__) <= 0) true, true, __func__) <= 0)
...@@ -1354,32 +1354,32 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) ...@@ -1354,32 +1354,32 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
} }
if (usb_endpoint_xfer_isoc(&urb->ep->desc)) if (usb_endpoint_xfer_isoc(&urb->ep->desc))
size = urb->number_of_packets; num_tds = urb->number_of_packets;
else if (usb_endpoint_is_bulk_out(&urb->ep->desc) && else if (usb_endpoint_is_bulk_out(&urb->ep->desc) &&
urb->transfer_buffer_length > 0 && urb->transfer_buffer_length > 0 &&
urb->transfer_flags & URB_ZERO_PACKET && urb->transfer_flags & URB_ZERO_PACKET &&
!(urb->transfer_buffer_length % usb_endpoint_maxp(&urb->ep->desc))) !(urb->transfer_buffer_length % usb_endpoint_maxp(&urb->ep->desc)))
size = 2; num_tds = 2;
else else
size = 1; num_tds = 1;
urb_priv = kzalloc(sizeof(struct urb_priv) + urb_priv = kzalloc(sizeof(struct urb_priv) +
size * sizeof(struct xhci_td *), mem_flags); num_tds * sizeof(struct xhci_td *), mem_flags);
if (!urb_priv) if (!urb_priv)
return -ENOMEM; return -ENOMEM;
buffer = kzalloc(size * sizeof(struct xhci_td), mem_flags); buffer = kzalloc(num_tds * sizeof(struct xhci_td), mem_flags);
if (!buffer) { if (!buffer) {
kfree(urb_priv); kfree(urb_priv);
return -ENOMEM; return -ENOMEM;
} }
for (i = 0; i < size; i++) { for (i = 0; i < num_tds; i++) {
urb_priv->td[i] = buffer; urb_priv->td[i] = buffer;
buffer++; buffer++;
} }
urb_priv->length = size; urb_priv->length = num_tds;
urb_priv->td_cnt = 0; urb_priv->td_cnt = 0;
urb->hcpriv = urb_priv; urb->hcpriv = urb_priv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册