All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot DWC2 warning removal
Date: Mon, 03 Feb 2014 23:42:20 -0700	[thread overview]
Message-ID: <52F08BCC.60903@wwwdotorg.org> (raw)

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;

                 reply	other threads:[~2014-02-04  6:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F08BCC.60903@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.