From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 03 Feb 2014 23:42:20 -0700 Subject: [U-Boot] U-Boot DWC2 warning removal Message-ID: <52F08BCC.60903@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Oleksandr, I made the following changes to remove some warnings from your DWC2 driver. I'm not sure they're correct; perhaps they expose some bugs... > diff --git a/drivers/usb/host/dwc_otg-hcd.c b/drivers/usb/host/dwc_otg-hcd.c > index a964681..e3c26f3 100644 > --- a/drivers/usb/host/dwc_otg-hcd.c > +++ b/drivers/usb/host/dwc_otg-hcd.c > @@ -249,7 +249,6 @@ static int dwc_otg_submit_rh_msg(struct usb_device *dev, unsigned long pipe, > int stat = 0; > __u16 bmRType_bReq; > __u16 wValue; > - __u16 wIndex; > __u16 wLength; > unsigned char data[32]; > hprt0_data_t hprt0 = {.d32 = 0 }; > @@ -261,7 +260,6 @@ static int dwc_otg_submit_rh_msg(struct usb_device *dev, unsigned long pipe, > > bmRType_bReq = cmd->requesttype | (cmd->request << 8); > wValue = cpu_to_le16 (cmd->value); > - wIndex = cpu_to_le16 (cmd->index); > wLength = cpu_to_le16 (cmd->length); > > switch (bmRType_bReq) { Perhaps wIndex should be used? > @@ -598,7 +596,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, > hctsiz_data_t hctsiz; > dwc_otg_host_if_t *host_if = g_core_if.host_if; > dwc_otg_hc_regs_t *hc_regs = host_if->hc_regs[CHANNEL]; > - hcint_data_t hcint; > hcint_data_t hcint_new; > /* For CONTROL endpoint pid should start with DATA1 */ > int status_direction; > @@ -632,9 +629,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, > hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); > hcchar.b.multicnt = 1; > > - /* Remember original int status */ > - hcint.d32 = dwc_read_reg32(&hc_regs->hcint); Does this read have a side-effect; should I keep the call to dwc_read_reg32(), but just remove the assignment? The comment implies this value is saved so that it can be restored later. However, I don't see anywhere that restores it; does that code need to be added? > - > /* Set host channel enable after all other setup is complete. */ > hcchar.b.chen = 1; > hcchar.b.chdis = 0; > @@ -677,8 +671,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, > hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); > hcchar.b.multicnt = 1; > > - hcint.d32 = dwc_read_reg32(&hc_regs->hcint); > - > /* Set host channel enable after all other setup is complete. */ > hcchar.b.chen = 1; > hcchar.b.chdis = 0; > @@ -731,8 +723,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, > hcchar.d32 = dwc_read_reg32(&hc_regs->hcchar); > hcchar.b.multicnt = 1; > > - hcint.d32 = dwc_read_reg32(&hc_regs->hcint); > - > /* Set host channel enable after all other setup is complete. */ > hcchar.b.chen = 1; > hcchar.b.chdis = 0;