linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: isp1760: isp1760-hcd.c: Drop condition with no effect
@ 2019-10-28 21:12 Saurav Girepunje
  2019-11-04 14:48 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Saurav Girepunje @ 2019-10-28 21:12 UTC (permalink / raw)
  To: gregkh, gustavo, saurav.girepunje, linux-usb, linux-kernel
  Cc: saurav.girepunje

As the "else if" and "else" branch body are identical the condition
has no effect. So drop the "else if" condition.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
 drivers/usb/isp1760/isp1760-hcd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
index 320fc4739835..579a21bd70ad 100644
--- a/drivers/usb/isp1760/isp1760-hcd.c
+++ b/drivers/usb/isp1760/isp1760-hcd.c
@@ -1032,8 +1032,6 @@ static int check_atl_transfer(struct usb_hcd *hcd, struct ptd *ptd,
 			urb->status = -EOVERFLOW;
 		else if (FROM_DW3_CERR(ptd->dw3))
 			urb->status = -EPIPE;  /* Stall */
-		else if (ptd->dw3 & DW3_ERROR_BIT)
-			urb->status = -EPROTO; /* XactErr */
 		else
 			urb->status = -EPROTO; /* Unknown */
 /*
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: isp1760: isp1760-hcd.c: Drop condition with no effect
  2019-10-28 21:12 [PATCH] usb: isp1760: isp1760-hcd.c: Drop condition with no effect Saurav Girepunje
@ 2019-11-04 14:48 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-11-04 14:48 UTC (permalink / raw)
  To: Saurav Girepunje; +Cc: gustavo, linux-usb, linux-kernel, saurav.girepunje

On Tue, Oct 29, 2019 at 02:42:14AM +0530, Saurav Girepunje wrote:
> As the "else if" and "else" branch body are identical the condition
> has no effect. So drop the "else if" condition.
> 
> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> ---
>  drivers/usb/isp1760/isp1760-hcd.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
> index 320fc4739835..579a21bd70ad 100644
> --- a/drivers/usb/isp1760/isp1760-hcd.c
> +++ b/drivers/usb/isp1760/isp1760-hcd.c
> @@ -1032,8 +1032,6 @@ static int check_atl_transfer(struct usb_hcd *hcd, struct ptd *ptd,
>  			urb->status = -EOVERFLOW;
>  		else if (FROM_DW3_CERR(ptd->dw3))
>  			urb->status = -EPIPE;  /* Stall */
> -		else if (ptd->dw3 & DW3_ERROR_BIT)
> -			urb->status = -EPROTO; /* XactErr */
>  		else
>  			urb->status = -EPROTO; /* Unknown */

Yes, the same thing happens, but look at the comment, this is two
different things.  So the code is good as-is.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-04 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 21:12 [PATCH] usb: isp1760: isp1760-hcd.c: Drop condition with no effect Saurav Girepunje
2019-11-04 14:48 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).