The check_trb_math() function and the check for sg buffers crossing 64k
boundaries are checks that the local function is correct.
Since the code is correct they can be removed.

Signed-off-by: David Laight <[email protected]>
---
 drivers/usb/host/xhci-ring.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index a0b248c..d84b183 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3150,22 +3150,6 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd 
*xhci, struct urb *urb)
        return num_trbs;
 }
 
-static void check_trb_math(struct urb *urb, int num_trbs, int running_total)
-{
-       if (num_trbs != 0)
-               dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated number of "
-                               "TRBs, %d left\n", __func__,
-                               urb->ep->desc.bEndpointAddress, num_trbs);
-       if (running_total != urb->transfer_buffer_length)
-               dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, 
"
-                               "queued %#x (%d), asked for %#x (%d)\n",
-                               __func__,
-                               urb->ep->desc.bEndpointAddress,
-                               running_total, running_total,
-                               urb->transfer_buffer_length,
-                               urb->transfer_buffer_length);
-}
-
 static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
                unsigned int ep_index, unsigned int stream_id, int start_cycle,
                struct xhci_generic_trb *start_trb)
@@ -3362,14 +3346,6 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t 
mem_flags,
                if (usb_urb_dir_in(urb))
                        field |= TRB_ISP;
 
-               if (TRB_MAX_BUFF_SIZE -
-                               (addr & (TRB_MAX_BUFF_SIZE - 1)) < 
trb_buff_len) {
-                       xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB 
boundaries!\n");
-                       xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n",
-                                       (unsigned int) (addr + 
TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),
-                                       (unsigned int) addr + trb_buff_len);
-               }
-
                /* Set the TRB length, TD size, and interrupter fields. */
                if (xhci->hci_version < 0x100) {
                        remainder = xhci_td_remainder(
@@ -3419,7 +3395,6 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t 
mem_flags,
                                urb->transfer_buffer_length - running_total;
        } while (running_total < urb->transfer_buffer_length);
 
-       check_trb_math(urb, num_trbs, running_total);
        giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
                        start_cycle, start_trb);
        return 0;
@@ -3558,7 +3533,6 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t 
mem_flags,
                        trb_buff_len = TRB_MAX_BUFF_SIZE;
        } while (running_total < urb->transfer_buffer_length);
 
-       check_trb_math(urb, num_trbs, running_total);
        giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
                        start_cycle, start_trb);
        return 0;
-- 
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to