[PATCH 11/30] usb: dwc2: gadget: Avoid pointless read of EP control register

From: Lee Jones
Date: Thu Jul 02 2020 - 10:48:56 EST


Commit ec1f9d9f01384 ("usb: dwc2: gadget: parity fix in isochronous mode") moved
these checks to dwc2_hsotg_change_ep_iso_parity() back in 2015. The assigned
value hasn't been read back since. Let's remove the unnecessary H/W read.

Fixes the following W=1 warning:

drivers/usb/dwc2/gadget.c: In function âdwc2_hsotg_epintâ:
drivers/usb/dwc2/gadget.c:2981:6: warning: variable âctrlâ set but not used [-Wunused-but-set-variable]
2981 | u32 ctrl;
| ^~~~

Cc: Minas Harutyunyan <hminas@xxxxxxxxxxxx>
Cc: Ben Dooks <ben@xxxxxxxxxxxx>
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
drivers/usb/dwc2/gadget.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 116e6175c7a48..fa07e3fcb8841 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2975,10 +2975,8 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
u32 epctl_reg = dir_in ? DIEPCTL(idx) : DOEPCTL(idx);
u32 epsiz_reg = dir_in ? DIEPTSIZ(idx) : DOEPTSIZ(idx);
u32 ints;
- u32 ctrl;

ints = dwc2_gadget_read_ep_interrupts(hsotg, idx, dir_in);
- ctrl = dwc2_readl(hsotg, epctl_reg);

/* Clear endpoint interrupts */
dwc2_writel(hsotg, ints, epint_reg);
--
2.25.1