Re: [PATCH 2/3] usb: dwc3: use BIT() macro where possible

2017-02-16 Thread Roger Quadros
On 16/02/17 10:54, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros  writes:
>> On 15/02/17 13:44, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Roger Quadros  writes:
 To avoid checkpatch warnings with new patches let's
 start using the BIT() macro wherever possible.

 Signed-off-by: Roger Quadros 
 ---
  drivers/usb/dwc3/core.h  | 192 
 +--
  drivers/usb/dwc3/dwc3-omap.c |  48 +--
  drivers/usb/dwc3/gadget.h|  20 ++---
  3 files changed, 130 insertions(+), 130 deletions(-)

 diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
 index 14b7602..d514dca 100644
 --- a/drivers/usb/dwc3/core.h
 +++ b/drivers/usb/dwc3/core.h
 @@ -65,7 +65,7 @@
  #define DWC3_DEVICE_EVENT_OVERFLOW11
  
  #define DWC3_GEVNTCOUNT_MASK  0xfffc
 -#define DWC3_GEVNTCOUNT_EHB   (1 << 31)
 +#define DWC3_GEVNTCOUNT_EHB   BIT(31)
>>>
>>> don't you need to include  for this?
>>>
>>
>> I didn't get any build errors though.
> 
> indirect inclusion. Problems will show up only when headers are moved
> around ;-)
> 
Yes. better to include it. I'll send a v2 for this.

-- 
cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] usb: dwc3: use BIT() macro where possible

2017-02-16 Thread Felipe Balbi

Hi,

Roger Quadros  writes:
> On 15/02/17 13:44, Felipe Balbi wrote:
>> 
>> Hi,
>> 
>> Roger Quadros  writes:
>>> To avoid checkpatch warnings with new patches let's
>>> start using the BIT() macro wherever possible.
>>>
>>> Signed-off-by: Roger Quadros 
>>> ---
>>>  drivers/usb/dwc3/core.h  | 192 
>>> +--
>>>  drivers/usb/dwc3/dwc3-omap.c |  48 +--
>>>  drivers/usb/dwc3/gadget.h|  20 ++---
>>>  3 files changed, 130 insertions(+), 130 deletions(-)
>>>
>>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
>>> index 14b7602..d514dca 100644
>>> --- a/drivers/usb/dwc3/core.h
>>> +++ b/drivers/usb/dwc3/core.h
>>> @@ -65,7 +65,7 @@
>>>  #define DWC3_DEVICE_EVENT_OVERFLOW 11
>>>  
>>>  #define DWC3_GEVNTCOUNT_MASK   0xfffc
>>> -#define DWC3_GEVNTCOUNT_EHB(1 << 31)
>>> +#define DWC3_GEVNTCOUNT_EHBBIT(31)
>> 
>> don't you need to include  for this?
>> 
>
> I didn't get any build errors though.

indirect inclusion. Problems will show up only when headers are moved
around ;-)

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH 2/3] usb: dwc3: use BIT() macro where possible

2017-02-15 Thread Roger Quadros
On 15/02/17 13:44, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros  writes:
>> To avoid checkpatch warnings with new patches let's
>> start using the BIT() macro wherever possible.
>>
>> Signed-off-by: Roger Quadros 
>> ---
>>  drivers/usb/dwc3/core.h  | 192 
>> +--
>>  drivers/usb/dwc3/dwc3-omap.c |  48 +--
>>  drivers/usb/dwc3/gadget.h|  20 ++---
>>  3 files changed, 130 insertions(+), 130 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
>> index 14b7602..d514dca 100644
>> --- a/drivers/usb/dwc3/core.h
>> +++ b/drivers/usb/dwc3/core.h
>> @@ -65,7 +65,7 @@
>>  #define DWC3_DEVICE_EVENT_OVERFLOW  11
>>  
>>  #define DWC3_GEVNTCOUNT_MASK0xfffc
>> -#define DWC3_GEVNTCOUNT_EHB (1 << 31)
>> +#define DWC3_GEVNTCOUNT_EHB BIT(31)
> 
> don't you need to include  for this?
> 

I didn't get any build errors though.

-- 
cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] usb: dwc3: use BIT() macro where possible

2017-02-15 Thread Felipe Balbi

Hi,

Roger Quadros  writes:
> To avoid checkpatch warnings with new patches let's
> start using the BIT() macro wherever possible.
>
> Signed-off-by: Roger Quadros 
> ---
>  drivers/usb/dwc3/core.h  | 192 
> +--
>  drivers/usb/dwc3/dwc3-omap.c |  48 +--
>  drivers/usb/dwc3/gadget.h|  20 ++---
>  3 files changed, 130 insertions(+), 130 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 14b7602..d514dca 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -65,7 +65,7 @@
>  #define DWC3_DEVICE_EVENT_OVERFLOW   11
>  
>  #define DWC3_GEVNTCOUNT_MASK 0xfffc
> -#define DWC3_GEVNTCOUNT_EHB  (1 << 31)
> +#define DWC3_GEVNTCOUNT_EHB  BIT(31)

don't you need to include  for this?

-- 
balbi


signature.asc
Description: PGP signature


[PATCH 2/3] usb: dwc3: use BIT() macro where possible

2017-02-15 Thread Roger Quadros
To avoid checkpatch warnings with new patches let's
start using the BIT() macro wherever possible.

Signed-off-by: Roger Quadros 
---
 drivers/usb/dwc3/core.h  | 192 +--
 drivers/usb/dwc3/dwc3-omap.c |  48 +--
 drivers/usb/dwc3/gadget.h|  20 ++---
 3 files changed, 130 insertions(+), 130 deletions(-)

diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 14b7602..d514dca 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -65,7 +65,7 @@
 #define DWC3_DEVICE_EVENT_OVERFLOW 11
 
 #define DWC3_GEVNTCOUNT_MASK   0xfffc
-#define DWC3_GEVNTCOUNT_EHB(1 << 31)
+#define DWC3_GEVNTCOUNT_EHBBIT(31)
 #define DWC3_GSNPSID_MASK  0x
 #define DWC3_GSNPSREV_MASK 0x
 
@@ -175,11 +175,11 @@
 /* Global RX Threshold Configuration Register */
 #define DWC3_GRXTHRCFG_MAXRXBURSTSIZE(n) (((n) & 0x1f) << 19)
 #define DWC3_GRXTHRCFG_RXPKTCNT(n) (((n) & 0xf) << 24)
-#define DWC3_GRXTHRCFG_PKTCNTSEL (1 << 29)
+#define DWC3_GRXTHRCFG_PKTCNTSEL BIT(29)
 
 /* Global Configuration Register */
 #define DWC3_GCTL_PWRDNSCALE(n)((n) << 19)
-#define DWC3_GCTL_U2RSTECN (1 << 16)
+#define DWC3_GCTL_U2RSTECN BIT(16)
 #define DWC3_GCTL_RAMCLKSEL(x) (((x) & DWC3_GCTL_CLK_MASK) << 6)
 #define DWC3_GCTL_CLK_BUS  (0)
 #define DWC3_GCTL_CLK_PIPE (1)
@@ -192,24 +192,24 @@
 #define DWC3_GCTL_PRTCAP_DEVICE2
 #define DWC3_GCTL_PRTCAP_OTG   3
 
-#define DWC3_GCTL_CORESOFTRESET(1 << 11)
-#define DWC3_GCTL_SOFITPSYNC   (1 << 10)
+#define DWC3_GCTL_CORESOFTRESETBIT(11)
+#define DWC3_GCTL_SOFITPSYNC   BIT(10)
 #define DWC3_GCTL_SCALEDOWN(n) ((n) << 4)
 #define DWC3_GCTL_SCALEDOWN_MASK   DWC3_GCTL_SCALEDOWN(3)
-#define DWC3_GCTL_DISSCRAMBLE  (1 << 3)
-#define DWC3_GCTL_U2EXIT_LFPS  (1 << 2)
-#define DWC3_GCTL_GBLHIBERNATIONEN (1 << 1)
-#define DWC3_GCTL_DSBLCLKGTNG  (1 << 0)
+#define DWC3_GCTL_DISSCRAMBLE  BIT(3)
+#define DWC3_GCTL_U2EXIT_LFPS  BIT(2)
+#define DWC3_GCTL_GBLHIBERNATIONEN BIT(1)
+#define DWC3_GCTL_DSBLCLKGTNG  BIT(0)
 
 /* Global User Control 1 Register */
-#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW  (1 << 24)
+#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW  BIT(24)
 
 /* Global USB2 PHY Configuration Register */
-#define DWC3_GUSB2PHYCFG_PHYSOFTRST(1 << 31)
-#define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS (1 << 30)
-#define DWC3_GUSB2PHYCFG_SUSPHY(1 << 6)
-#define DWC3_GUSB2PHYCFG_ULPI_UTMI (1 << 4)
-#define DWC3_GUSB2PHYCFG_ENBLSLPM  (1 << 8)
+#define DWC3_GUSB2PHYCFG_PHYSOFTRSTBIT(31)
+#define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS BIT(30)
+#define DWC3_GUSB2PHYCFG_SUSPHYBIT(6)
+#define DWC3_GUSB2PHYCFG_ULPI_UTMI BIT(4)
+#define DWC3_GUSB2PHYCFG_ENBLSLPM  BIT(8)
 #define DWC3_GUSB2PHYCFG_PHYIF(n)  (n << 3)
 #define DWC3_GUSB2PHYCFG_PHYIF_MASKDWC3_GUSB2PHYCFG_PHYIF(1)
 #define DWC3_GUSB2PHYCFG_USBTRDTIM(n)  (n << 10)
@@ -220,25 +220,25 @@
 #define UTMI_PHYIF_8_BIT   0
 
 /* Global USB2 PHY Vendor Control Register */
-#define DWC3_GUSB2PHYACC_NEWREGREQ (1 << 25)
-#define DWC3_GUSB2PHYACC_BUSY  (1 << 23)
-#define DWC3_GUSB2PHYACC_WRITE (1 << 22)
+#define DWC3_GUSB2PHYACC_NEWREGREQ BIT(25)
+#define DWC3_GUSB2PHYACC_BUSY  BIT(23)
+#define DWC3_GUSB2PHYACC_WRITE BIT(22)
 #define DWC3_GUSB2PHYACC_ADDR(n)   (n << 16)
 #define DWC3_GUSB2PHYACC_EXTEND_ADDR(n)(n << 8)
 #define DWC3_GUSB2PHYACC_DATA(n)   (n & 0xff)
 
 /* Global USB3 PIPE Control Register */
-#define DWC3_GUSB3PIPECTL_PHYSOFTRST   (1 << 31)
-#define DWC3_GUSB3PIPECTL_U2SSINP3OK   (1 << 29)
-#define DWC3_GUSB3PIPECTL_DISRXDETINP3 (1 << 28)
-#define DWC3_GUSB3PIPECTL_REQP1P2P3(1 << 24)
+#define DWC3_GUSB3PIPECTL_PHYSOFTRST   BIT(31)
+#define DWC3_GUSB3PIPECTL_U2SSINP3OK   BIT(29)
+#define DWC3_GUSB3PIPECTL_DISRXDETINP3 BIT(28)
+#define DWC3_GUSB3PIPECTL_REQP1P2P3BIT(24)
 #define DWC3_GUSB3PIPECTL_DEP1P2P3(n)  ((n) << 19)
 #define DWC3_GUSB3PIPECTL_DEP1P2P3_MASKDWC3_GUSB3PIPECTL_DEP1P2P3(7)
 #define DWC3_GUSB3PIPECTL_DEP1P2P3_EN  DWC3_GUSB3PIPECTL_DEP1P2P3(1)
-#define DWC3_GUSB3PIPECTL_DEPOCHANGE   (1 << 18)
-#define DWC3_GUSB3PIPECTL_SUSPHY   (1 << 17)
-#define DWC3_GUSB3PIPECTL_LFPSFILT (1 << 9)
-#define DWC3_GUSB3PIPECTL_RX_DETOPOLL  (1 << 8)
+#define DWC3_GUSB3PIPECTL_DEPOCHANGE   BIT(18)
+#define DWC3_GUSB3PIPECTL_SUSPHY   BIT(17)
+#define DWC3_GUSB3PIPECTL_LFPSFILT BIT(9)
+#define DWC3_GUSB3PIPECTL_RX_DETOPOLL  BIT(8)
 #define DWC3_GUSB3PIPECTL_TX_DEEPH_MASKDWC3_GUSB3PIPECTL_TX_DEEPH(3)
 #define DWC3_GUSB3PIPECTL_TX_DEEPH(n)  ((n) << 1)
 
@@ -247,7 +247,7 @@
 #define DWC3_GTXFIFOSIZ_TXFSTADDR(n)   ((n) & 0x)
 
 /* Global Event Size Registers */
-#define DWC3_GEVNTSIZ_INTMASK  (1 << 31)
+#define DWC3_GEVNTSIZ_INTMASK