From: Dan Carpenter Date: Tue, 3 May 2016 07:49:00 +0000 (+0300) Subject: UPSTREAM: usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP() X-Git-Tag: firefly_0821_release~1843 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=68213a9bacf6f17919aca6fa46a4ca53def56e72;p=firefly-linux-kernel-4.4.55.git UPSTREAM: usb: dwc3: gadget: fix mask and shift order in DWC3_DCFG_NUMP() In the original DWC3_DCFG_NUMP() was always zero. It looks like the intent was to shift first and then do the mask. Change-Id: I290fe7bb82bbf7adf626fcb5ee2474fce60167bd Fixes: 2a58f9c12bb3 ('usb: dwc3: gadget: disable automatic calculation of ACK TP NUMP') Signed-off-by: Dan Carpenter Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman Signed-off-by: Wu Liang feng (cherry picked from commit 973986126a4152ab83d09263a02bf7d2d1bf3b6e) --- diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 78f29796f453..e947bb91b1e5 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -276,7 +276,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)