summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2020-07-02 17:46:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-03 11:18:40 +0300
commit6181aa1bc446e2fa48ed4f2ff97a4e0503c8931b (patch)
tree72754bd8942f8255751cb40de3a26ff55c0b4add /drivers/usb/host
parentaa88cddf4c9e03224db794168fa34501657ec3d6 (diff)
downloadlinux-6181aa1bc446e2fa48ed4f2ff97a4e0503c8931b.tar.xz
usb: host: oxu210hp-hcd: Move declaration of 'qtd' into 'ifdef OXU_URB_TRACE'
If we assign 'epnum' during the declaration we can also avoid "ISO C90 forbids mixed declarations" issues. So it does looks like we can have our cake and eat it in this scenario. Fixes the following W=1 kernel build warning(s): drivers/usb/host/oxu210hp-hcd.c: In function ‘submit_async’: drivers/usb/host/oxu210hp-hcd.c:2040:19: warning: variable ‘qtd’ set but not used [-Wunused-but-set-variable] 2040 | struct ehci_qtd *qtd; | ^~~ Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Rodolfo Giometti <giometti@linux.it> Cc: "Eurotech S.p.A" <info@eurtech.it> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200702144625.2533530-24-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/oxu210hp-hcd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 120666a0d590..b00673295c9f 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -2037,16 +2037,15 @@ static struct ehci_qh *qh_append_tds(struct oxu_hcd *oxu,
static int submit_async(struct oxu_hcd *oxu, struct urb *urb,
struct list_head *qtd_list, gfp_t mem_flags)
{
- struct ehci_qtd *qtd;
- int epnum;
+ int epnum = urb->ep->desc.bEndpointAddress;
unsigned long flags;
struct ehci_qh *qh = NULL;
int rc = 0;
+#ifdef OXU_URB_TRACE
+ struct ehci_qtd *qtd;
qtd = list_entry(qtd_list->next, struct ehci_qtd, qtd_list);
- epnum = urb->ep->desc.bEndpointAddress;
-#ifdef OXU_URB_TRACE
oxu_dbg(oxu, "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
__func__, urb->dev->devpath, urb,
epnum & 0x0f, (epnum & USB_DIR_IN) ? "in" : "out",