Skip to contentSkip to conversation

usb: xhci: Fix build warning

PATCH Superseded Corentin Labbe 2 participants 5 messages Oct 25, 2017 – Oct 26, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 usb: xhci: Fix build warning

This patch fix the following build warnings:
drivers/usb/host/xhci.c:3378:6: warning: variable 'last_freed_endpoint' set but not used [-Wunused-but-set-variable]

---
 drivers/usb/host/xhci.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/usb/host/xhci.c +0 -3
index ee077a21dfda..b12b2bdd7b47 100644
@@ -3375,7 +3375,6 @@ static int xhci_discover_or_reset_device(struct usb_hcd *hcd,
 	unsigned int slot_id;
 	struct xhci_virt_device *virt_dev;
 	struct xhci_command *reset_device_cmd;
-	int last_freed_endpoint;
 	struct xhci_slot_ctx *slot_ctx;
 	int old_active_eps = 0;
 
@@ -3490,7 +3489,6 @@ static int xhci_discover_or_reset_device(struct usb_hcd *hcd,
 	}
 
 	/* Everything but endpoint 0 is disabled, so free the rings. */
-	last_freed_endpoint = 1;
 	for (i = 1; i < 31; i++) {
 		struct xhci_virt_ep *ep = &virt_dev->eps[i];
 
@@ -3505,7 +3503,6 @@ static int xhci_discover_or_reset_device(struct usb_hcd *hcd,
 		if (ep->ring) {
 			xhci_debugfs_remove_endpoint(xhci, virt_dev, i);
 			xhci_free_endpoint_ring(xhci, virt_dev, i);
-			last_freed_endpoint = i;
 		}
 		if (!list_empty(&virt_dev->eps[i].bw_endpoint_list))
 			xhci_drop_ep_from_interval_table(xhci,
Signature · 1 line
2.13.6
#1 lore raw

PATCH 2/4 usb: xhci: Fix build warning

This patch fix the following build warning:
drivers/usb/host/xhci.c:2853:23: warning: variable 'ep' set but not used [-Wunused-but-set-variable]

---
 drivers/usb/host/xhci.c | 2 --
 1 file changed, 2 deletions(-)
drivers/usb/host/xhci.c +0 -2
index b12b2bdd7b47..eae86bd7eac8 100644
@@ -2850,12 +2850,10 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index,
 			       unsigned int stream_id, struct xhci_td *td)
 {
 	struct xhci_dequeue_state deq_state;
-	struct xhci_virt_ep *ep;
 	struct usb_device *udev = td->urb->dev;
 
 	xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
 			"Cleaning up stalled endpoint ring");
-	ep = &xhci->devs[udev->slot_id]->eps[ep_index];
 	/* We need to move the HW's dequeue pointer past this TD,
 	 * or it will attempt to resend it on the next doorbell ring.
 	 */
Signature · 1 line
2.13.6
#2 lore raw

PATCH 3/4 usb: xhci: Fix build warning

In reply to Corentin Labbe

This patch fix the following build warning:
drivers/usb/host/xhci-ring.c:1895:19: warning: variable 'urb_priv' set but not used [-Wunused-but-set-variable]

---
 drivers/usb/host/xhci-ring.c | 2 --
 1 file changed, 2 deletions(-)
drivers/usb/host/xhci-ring.c +0 -2
index 521d19e82494..942eeb351a3a 100644
@@ -1890,12 +1890,10 @@ int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code)
 static int xhci_td_cleanup(struct xhci_hcd *xhci, struct xhci_td *td,
 		struct xhci_ring *ep_ring, int *status)
 {
-	struct urb_priv	*urb_priv;
 	struct urb *urb = NULL;
 
 	/* Clean up the endpoint's TD list */
 	urb = td->urb;
-	urb_priv = urb->hcpriv;
 
 	/* if a bounce buffer was used to align this td then unmap it */
 	xhci_unmap_td_bounce_buffer(xhci, ep_ring, td);
Signature · 1 line
2.13.6
#3 lore raw

PATCH 4/4 usb: xhci: Fix build warning

In reply to Corentin Labbe

This patch fix the following build warnings:
drivers/usb/host/xhci-ring.c:2011:20: warning: variable 'ep_ring' set but not used [-Wunused-but-set-variable]

---
 drivers/usb/host/xhci-ring.c | 2 --
 1 file changed, 2 deletions(-)
drivers/usb/host/xhci-ring.c +0 -2
index 942eeb351a3a..27d657ec5ed5 100644
@@ -2004,7 +2004,6 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
 	struct xhci_virt_ep *ep, int *status)
 {
 	struct xhci_virt_device *xdev;
-	struct xhci_ring *ep_ring;
 	unsigned int slot_id;
 	int ep_index;
 	struct xhci_ep_ctx *ep_ctx;
@@ -2016,7 +2015,6 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
 	slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));
 	xdev = xhci->devs[slot_id];
 	ep_index = TRB_TO_EP_ID(le32_to_cpu(event->flags)) - 1;
-	ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer));
 	ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index);
 	trb_comp_code = GET_COMP_CODE(le32_to_cpu(event->transfer_len));
 	requested = td->urb->transfer_buffer_length;
Signature · 1 line
2.13.6
maintainer
#4 lore raw
In reply to Corentin Labbe
Quoted 7 lines · Corentin Labbe

This patch fix the following build warnings:
drivers/usb/host/xhci.c:3378:6: warning: variable 'last_freed_endpoint' set but not used [-Wunused-but-set-variable]

---
 drivers/usb/host/xhci.c | 3 ---
 1 file changed, 3 deletions(-)

You sent 4 patches with the same identical subject line, yet they do different things. That's not acceptable at all, sorry...

greg k-h