Some parameters are not used by functions in xhci-mem.c, just
remove it.

Changes compared to v1:
- Rebase to the latest usb-next branch

Signed-off-by: Lin Wang <lin.x.w...@intel.com>
---
 drivers/usb/host/xhci-dbg.c  |    2 +-
 drivers/usb/host/xhci-mem.c  |   21 +++++++++------------
 drivers/usb/host/xhci-ring.c |    6 +++---
 drivers/usb/host/xhci.c      |   34 +++++++++++++++++-----------------
 drivers/usb/host/xhci.h      |    7 +++----
 5 files changed, 33 insertions(+), 37 deletions(-)

diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index bb89175..745717e 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -552,7 +552,7 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci,
 
        if (ctx->type == XHCI_CTX_TYPE_INPUT) {
                struct xhci_input_control_ctx *ctrl_ctx =
-                       xhci_get_input_control_ctx(xhci, ctx);
+                       xhci_get_input_control_ctx(ctx);
                if (!ctrl_ctx) {
                        xhci_warn(xhci, "Could not get input context, bad 
type.\n");
                        return;
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 5cb3d7a..2e6eaf4 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -535,7 +535,7 @@ static void xhci_free_container_ctx(struct xhci_hcd *xhci,
        kfree(ctx);
 }
 
-struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd 
*xhci,
+struct xhci_input_control_ctx *xhci_get_input_control_ctx(
                                              struct xhci_container_ctx *ctx)
 {
        if (ctx->type != XHCI_CTX_TYPE_INPUT)
@@ -784,8 +784,7 @@ void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci,
  * Reinstalls the "normal" endpoint ring (at its previous dequeue mark,
  * not at the beginning of the ring).
  */
-void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci,
-               struct xhci_ep_ctx *ep_ctx,
+void xhci_setup_no_streams_ep_input_ctx(struct xhci_ep_ctx *ep_ctx,
                struct xhci_virt_ep *ep)
 {
        dma_addr_t addr;
@@ -1342,8 +1341,7 @@ static u32 xhci_get_endpoint_mult(struct usb_device *udev,
        return ep->ss_ep_comp.bmAttributes;
 }
 
-static u32 xhci_get_endpoint_type(struct usb_device *udev,
-               struct usb_host_endpoint *ep)
+static u32 xhci_get_endpoint_type(struct usb_host_endpoint *ep)
 {
        int in;
        u32 type;
@@ -1376,8 +1374,7 @@ static u32 xhci_get_endpoint_type(struct usb_device *udev,
  * Basically, this is the maxpacket size, multiplied by the burst size
  * and mult size.
  */
-static u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci,
-               struct usb_device *udev,
+static u32 xhci_get_max_esit_payload(struct usb_device *udev,
                struct usb_host_endpoint *ep)
 {
        int max_burst;
@@ -1418,7 +1415,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
        ep_index = xhci_get_endpoint_index(&ep->desc);
        ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
 
-       endpoint_type = xhci_get_endpoint_type(udev, ep);
+       endpoint_type = xhci_get_endpoint_type(ep);
        if (!endpoint_type)
                return -EINVAL;
        ep_ctx->ep_info2 = cpu_to_le32(endpoint_type);
@@ -1484,7 +1481,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
        }
        ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) |
                        MAX_BURST(max_burst));
-       max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep);
+       max_esit_payload = xhci_get_max_esit_payload(udev, ep);
        ep_ctx->tx_info = 
cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload));
 
        /*
@@ -1773,7 +1770,7 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd 
*xhci,
        return command;
 }
 
-void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv)
+void xhci_urb_free_priv(struct urb_priv *urb_priv)
 {
        if (urb_priv) {
                kfree(urb_priv->td[0]);
@@ -1926,7 +1923,7 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci,
 }
 
 /* TRB math checks for xhci_trb_in_td(), using the command and event rings. */
-static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags)
+static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci)
 {
        struct {
                dma_addr_t              input_dma;
@@ -2452,7 +2449,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
                                                flags);
        if (!xhci->event_ring)
                goto fail;
-       if (xhci_check_trb_in_td_math(xhci, flags) < 0)
+       if (xhci_check_trb_in_td_math(xhci) < 0)
                goto fail;
 
        xhci->erst.entries = dma_alloc_coherent(dev,
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index e692e76..5e1090a 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -609,7 +609,7 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci,
 
                spin_unlock(&xhci->lock);
                usb_hcd_giveback_urb(hcd, urb, status);
-               xhci_urb_free_priv(xhci, urb_priv);
+               xhci_urb_free_priv(urb_priv);
                spin_lock(&xhci->lock);
        }
 }
@@ -1110,7 +1110,7 @@ static void xhci_handle_cmd_config_ep(struct xhci_hcd 
*xhci, int slot_id,
         * is not waiting on the configure endpoint command.
         */
        virt_dev = xhci->devs[slot_id];
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "Could not get input context, bad type.\n");
                return;
@@ -2497,7 +2497,7 @@ cleanup:
                        urb = td->urb;
                        urb_priv = urb->hcpriv;
 
-                       xhci_urb_free_priv(xhci, urb_priv);
+                       xhci_urb_free_priv(urb_priv);
 
                        usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), 
urb);
                        if ((urb->actual_length != urb->transfer_buffer_length 
&&
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 01fcbb5..c9f0f42 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1276,7 +1276,7 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, 
unsigned int slot_id,
                        return -ENOMEM;
 
                command->in_ctx = xhci->devs[slot_id]->in_ctx;
-               ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
+               ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
                if (!ctrl_ctx) {
                        xhci_warn(xhci, "%s: Could not get input context, bad 
type.\n",
                                        __func__);
@@ -1374,7 +1374,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb 
*urb, gfp_t mem_flags)
                        ret = xhci_check_maxpacket(xhci, slot_id,
                                        ep_index, urb);
                        if (ret < 0) {
-                               xhci_urb_free_priv(xhci, urb_priv);
+                               xhci_urb_free_priv(urb_priv);
                                urb->hcpriv = NULL;
                                return ret;
                        }
@@ -1440,7 +1440,7 @@ dying:
                        urb->ep->desc.bEndpointAddress, urb);
        ret = -ESHUTDOWN;
 free_priv:
-       xhci_urb_free_priv(xhci, urb_priv);
+       xhci_urb_free_priv(urb_priv);
        urb->hcpriv = NULL;
        spin_unlock_irqrestore(&xhci->lock, flags);
        return ret;
@@ -1553,7 +1553,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb 
*urb, int status)
                usb_hcd_unlink_urb_from_ep(hcd, urb);
                spin_unlock_irqrestore(&xhci->lock, flags);
                usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN);
-               xhci_urb_free_priv(xhci, urb_priv);
+               xhci_urb_free_priv(urb_priv);
                return ret;
        }
        if ((xhci->xhc_state & XHCI_STATE_DYING) ||
@@ -1660,7 +1660,7 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct 
usb_device *udev,
 
        in_ctx = xhci->devs[udev->slot_id]->in_ctx;
        out_ctx = xhci->devs[udev->slot_id]->out_ctx;
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -1746,7 +1746,7 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct 
usb_device *udev,
        virt_dev = xhci->devs[udev->slot_id];
        in_ctx = virt_dev->in_ctx;
        out_ctx = virt_dev->out_ctx;
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -1816,7 +1816,7 @@ static void xhci_zero_in_ctx(struct xhci_hcd *xhci, 
struct xhci_virt_device *vir
        struct xhci_slot_ctx *slot_ctx;
        int i;
 
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -2542,7 +2542,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
        if (virt_dev->tt_info)
                old_active_eps = virt_dev->tt_info->active_eps;
 
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -2639,7 +2639,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
        spin_lock_irqsave(&xhci->lock, flags);
        virt_dev = xhci->devs[udev->slot_id];
 
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
        if (!ctrl_ctx) {
                spin_unlock_irqrestore(&xhci->lock, flags);
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
@@ -2758,7 +2758,7 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct 
usb_device *udev)
        command->in_ctx = virt_dev->in_ctx;
 
        /* See section 4.6.6 - A0 = 1; A1 = D0 = D1 = 0 */
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -2883,7 +2883,7 @@ static void xhci_setup_input_ctx_for_quirk(struct 
xhci_hcd *xhci,
        dma_addr_t addr;
 
        in_ctx = xhci->devs[slot_id]->in_ctx;
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -3173,7 +3173,7 @@ int xhci_alloc_streams(struct usb_hcd *hcd, struct 
usb_device *udev,
                xhci_dbg(xhci, "Could not allocate xHCI command structure.\n");
                return -ENOMEM;
        }
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, config_cmd->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(config_cmd->in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -3328,7 +3328,7 @@ int xhci_free_streams(struct usb_hcd *hcd, struct 
usb_device *udev,
         */
        ep_index = xhci_get_endpoint_index(&eps[0]->desc);
        command = vdev->eps[ep_index].stream_info->free_streams_command;
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
        if (!ctrl_ctx) {
                spin_unlock_irqrestore(&xhci->lock, flags);
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
@@ -3346,7 +3346,7 @@ int xhci_free_streams(struct usb_hcd *hcd, struct 
usb_device *udev,
 
                xhci_endpoint_copy(xhci, command->in_ctx,
                                vdev->out_ctx, ep_index);
-               xhci_setup_no_streams_ep_input_ctx(xhci, ep_ctx,
+               xhci_setup_no_streams_ep_input_ctx(ep_ctx,
                                &vdev->eps[ep_index]);
        }
        xhci_setup_input_ctx_for_config_ep(xhci, command->in_ctx,
@@ -3811,7 +3811,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct 
usb_device *udev,
        command->completion = &xhci->addr_dev;
 
        slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
@@ -3994,7 +3994,7 @@ static int __maybe_unused 
xhci_change_max_exit_latency(struct xhci_hcd *xhci,
 
        /* Attempt to issue an Evaluate Context command to change the MEL. */
        command = xhci->lpm_command;
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
        if (!ctrl_ctx) {
                spin_unlock_irqrestore(&xhci->lock, flags);
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
@@ -4732,7 +4732,7 @@ int xhci_update_hub_device(struct usb_hcd *hcd, struct 
usb_device *hdev,
                xhci_dbg(xhci, "Could not allocate xHCI command structure.\n");
                return -ENOMEM;
        }
-       ctrl_ctx = xhci_get_input_control_ctx(xhci, config_cmd->in_ctx);
+       ctrl_ctx = xhci_get_input_control_ctx(config_cmd->in_ctx);
        if (!ctrl_ctx) {
                xhci_warn(xhci, "%s: Could not get input context, bad type.\n",
                                __func__);
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index cc7c5bb..32a42bc 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1712,8 +1712,7 @@ void xhci_free_stream_info(struct xhci_hcd *xhci,
 void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci,
                struct xhci_ep_ctx *ep_ctx,
                struct xhci_stream_info *stream_info);
-void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci,
-               struct xhci_ep_ctx *ep_ctx,
+void xhci_setup_no_streams_ep_input_ctx(struct xhci_ep_ctx *ep_ctx,
                struct xhci_virt_ep *ep);
 void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci,
        struct xhci_virt_device *virt_dev, bool drop_control_ep);
@@ -1727,7 +1726,7 @@ struct xhci_ring *xhci_stream_id_to_ring(
 struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
                bool allocate_in_ctx, bool allocate_completion,
                gfp_t mem_flags);
-void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv);
+void xhci_urb_free_priv(struct urb_priv *urb_priv);
 void xhci_free_command(struct xhci_hcd *xhci,
                struct xhci_command *command);
 
@@ -1864,7 +1863,7 @@ int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct 
xhci_hcd *xhci,
 void xhci_ring_device(struct xhci_hcd *xhci, int slot_id);
 
 /* xHCI contexts */
-struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd 
*xhci, struct xhci_container_ctx *ctx);
+struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct 
xhci_container_ctx *ctx);
 struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct 
xhci_container_ctx *ctx);
 struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct 
xhci_container_ctx *ctx, unsigned int ep_index);
 
-- 
1.7.9.5

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

Reply via email to