diff options
author | David Daney <ddaney@caviumnetworks.com> | 2011-01-25 12:59:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-04 14:43:59 -0500 |
commit | eb34a90861a290cd271f4b887c0d59070e1b69b0 (patch) | |
tree | 628c648d44be4c7ef57c29c11ed848c0f9a22ebd /drivers/usb/host/ehci-q.c | |
parent | 9a1cadb9dd9130345d59638f5b6a8a4982c2b34a (diff) |
USB: EHCI: Rearrange EHCI_URB_TRACE code to avoid GCC-4.6 warnings.
With pre-release GCC-4.6, we get a 'set but not used' warning when
EHCI_URB_TRACE is not set because we set the qtd variable without
using it.
Rearrange the statements so that we only set qtd if it will be used.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-q.c')
-rw-r--r-- | drivers/usb/host/ehci-q.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 233c288e3f93..fe99895fb098 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -1107,22 +1107,24 @@ submit_async ( | |||
1107 | struct list_head *qtd_list, | 1107 | struct list_head *qtd_list, |
1108 | gfp_t mem_flags | 1108 | gfp_t mem_flags |
1109 | ) { | 1109 | ) { |
1110 | struct ehci_qtd *qtd; | ||
1111 | int epnum; | 1110 | int epnum; |
1112 | unsigned long flags; | 1111 | unsigned long flags; |
1113 | struct ehci_qh *qh = NULL; | 1112 | struct ehci_qh *qh = NULL; |
1114 | int rc; | 1113 | int rc; |
1115 | 1114 | ||
1116 | qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list); | ||
1117 | epnum = urb->ep->desc.bEndpointAddress; | 1115 | epnum = urb->ep->desc.bEndpointAddress; |
1118 | 1116 | ||
1119 | #ifdef EHCI_URB_TRACE | 1117 | #ifdef EHCI_URB_TRACE |
1120 | ehci_dbg (ehci, | 1118 | { |
1121 | "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n", | 1119 | struct ehci_qtd *qtd; |
1122 | __func__, urb->dev->devpath, urb, | 1120 | qtd = list_entry(qtd_list->next, struct ehci_qtd, qtd_list); |
1123 | epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out", | 1121 | ehci_dbg(ehci, |
1124 | urb->transfer_buffer_length, | 1122 | "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n", |
1125 | qtd, urb->ep->hcpriv); | 1123 | __func__, urb->dev->devpath, urb, |
1124 | epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out", | ||
1125 | urb->transfer_buffer_length, | ||
1126 | qtd, urb->ep->hcpriv); | ||
1127 | } | ||
1126 | #endif | 1128 | #endif |
1127 | 1129 | ||
1128 | spin_lock_irqsave (&ehci->lock, flags); | 1130 | spin_lock_irqsave (&ehci->lock, flags); |