public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP()
@ 2016-05-03  7:49 Dan Carpenter
  2016-05-03  7:53 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-05-03  7:49 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, kernel-janitors

In the original DWC3_DCFG_NUMP() was always zero.  It looks like the
intent was to shift first and then do the mask.

Fixes: 2a58f9c12bb3 ('usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 186a886..7ddf944 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -277,7 +277,7 @@
 #define DWC3_DCFG_FULLSPEED1	(3 << 0)
 
 #define DWC3_DCFG_NUMP_SHIFT	17
-#define DWC3_DCFG_NUMP(n)	(((n) & 0x1f) >> DWC3_DCFG_NUMP_SHIFT)
+#define DWC3_DCFG_NUMP(n)	(((n) >> DWC3_DCFG_NUMP_SHIFT) & 0x1f)
 #define DWC3_DCFG_NUMP_MASK	(0x1f << DWC3_DCFG_NUMP_SHIFT)
 #define DWC3_DCFG_LPM_CAP	(1 << 22)
 

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

* Re: [patch] usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP()
  2016-05-03  7:49 [patch] usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP() Dan Carpenter
@ 2016-05-03  7:53 ` Felipe Balbi
  2016-05-03 21:19   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2016-05-03  7:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]


Hi,

Dan Carpenter <dan.carpenter@oracle.com> writes:
> In the original DWC3_DCFG_NUMP() was always zero.  It looks like the
> intent was to shift first and then do the mask.
>
> Fixes: 2a58f9c12bb3 ('usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for this fix, I completely missed it :-) Greg, if you want to
take this as a patch, that's fine by me. Otherwise I can queue it for
-rc1. In any case, S-o-B below:

Signed-off-by: Felipe Balbi <balbi@kernel.org>

> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 186a886..7ddf944 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -277,7 +277,7 @@
>  #define DWC3_DCFG_FULLSPEED1	(3 << 0)
>  
>  #define DWC3_DCFG_NUMP_SHIFT	17
> -#define DWC3_DCFG_NUMP(n)	(((n) & 0x1f) >> DWC3_DCFG_NUMP_SHIFT)
> +#define DWC3_DCFG_NUMP(n)	(((n) >> DWC3_DCFG_NUMP_SHIFT) & 0x1f)
>  #define DWC3_DCFG_NUMP_MASK	(0x1f << DWC3_DCFG_NUMP_SHIFT)
>  #define DWC3_DCFG_LPM_CAP	(1 << 22)
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

* Re: [patch] usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP()
  2016-05-03  7:53 ` Felipe Balbi
@ 2016-05-03 21:19   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2016-05-03 21:19 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Dan Carpenter, linux-usb, linux-kernel, kernel-janitors

On Tue, May 03, 2016 at 10:53:05AM +0300, Felipe Balbi wrote:
> 
> Hi,
> 
> Dan Carpenter <dan.carpenter@oracle.com> writes:
> > In the original DWC3_DCFG_NUMP() was always zero.  It looks like the
> > intent was to shift first and then do the mask.
> >
> > Fixes: 2a58f9c12bb3 ('usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP')
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Thanks for this fix, I completely missed it :-) Greg, if you want to
> take this as a patch, that's fine by me. Otherwise I can queue it for
> -rc1. In any case, S-o-B below:
> 
> Signed-off-by: Felipe Balbi <balbi@kernel.org>

I'll take it, thanks.

greg k-h

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

end of thread, other threads:[~2016-05-03 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03  7:49 [patch] usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP() Dan Carpenter
2016-05-03  7:53 ` Felipe Balbi
2016-05-03 21:19   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox