Re: [PATCH 1/2] staging: emxx_udc: Split line and fix eol parenthesis

2018-11-17 Thread Joe Perches
On Sat, 2018-11-17 at 00:46 +0100, Cristian Sicilia wrote:
> Fix some parenthesis opened at end of line.

It looks like this is all guarded by #ifdef UDC_DEBUG_DUMP
which is not ever set and this probably would not compile
if it was.

It's probably better to remove all the blocks guarded by
that flag and the flag itself.

> Signed-off-by: Cristian Sicilia 
> ---
>  drivers/staging/emxx_udc/emxx_udc.c | 73 
> ++---
>  1 file changed, 36 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
> b/drivers/staging/emxx_udc/emxx_udc.c
> index bf7c5da..26bd77c 100644
> --- a/drivers/staging/emxx_udc/emxx_udc.c
> +++ b/drivers/staging/emxx_udc/emxx_udc.c
> @@ -108,20 +108,20 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc 
> *udc)
>  
>   dev_dbg(>dev, "\n-USB REG-\n");
>   for (i = 0x0 ; i < USB_BASE_SIZE ; i += 16) {
> - reg_data =   _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i));
>   dev_dbg(>dev, "USB%04x =%08x", i, (int)reg_data);
>  
> - reg_data =  _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 4));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i + 4));
>   dev_dbg(>dev, " %08x", (int)reg_data);
>  
> - reg_data =  _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 8));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i + 8));
>   dev_dbg(>dev, " %08x", (int)reg_data);
>  
> - reg_data =  _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 12));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i + 12));
>   dev_dbg(>dev, " %08x\n", (int)reg_data);
>   }
>  
> @@ -473,22 +473,23 @@ static void _nbu2ss_dma_map_single(
>   if (req->unaligned) {
>   req->req.dma = ep->phys_buf;
>   } else {
> - req->req.dma = dma_map_single(
> - udc->gadget.dev.parent,
> - req->req.buf,
> - req->req.length,
> - (direct == USB_DIR_IN)
> - ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
> + req->req.dma =
> + dma_map_single(udc->gadget.dev.parent,
> +req->req.buf,
> +req->req.length,
> +(direct == USB_DIR_IN) ?
> + DMA_TO_DEVICE :
> + DMA_FROM_DEVICE);
>   }
>   req->mapped = 1;
>   } else {
>   if (!req->unaligned)
> - dma_sync_single_for_device(
> - udc->gadget.dev.parent,
> - req->req.dma,
> - req->req.length,
> - (direct == USB_DIR_IN)
> - ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
> + dma_sync_single_for_device(udc->gadget.dev.parent,
> +req->req.dma,
> +req->req.length,
> +(direct == USB_DIR_IN)
> + ? DMA_TO_DEVICE :
> + DMA_FROM_DEVICE);
>  
>   req->mapped = 0;
>   }
> @@ -975,8 +976,8 @@ static int _nbu2ss_epn_out_transfer(
>  
>   /*-*/
>   /* Receive Length */
> - i_recv_length
> - = _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
> + i_recv_length =
> + _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
>  
>   if (i_recv_length != 0) {
>   result = _nbu2ss_epn_out_data(udc, ep, req, i_recv_length);
> @@ -1115,10 +1116,9 @@ static int _nbu2ss_epn_in_pio(
>   i_word_length = length / sizeof(u32);
>   if (i_word_length > 0) {
>   for (i = 0; i < i_word_length; i++) {
> - _nbu2ss_writel(
> - >EP_REGS[ep->epnum - 1].EP_WRITE
> - , p_buf_32->dw
> - );
> + _nbu2ss_writel(>EP_REGS[ep->epnum -
> +   1].EP_WRITE,
> +

Re: [PATCH 1/2] staging: emxx_udc: Split line and fix eol parenthesis

2018-11-17 Thread Joe Perches
On Sat, 2018-11-17 at 00:46 +0100, Cristian Sicilia wrote:
> Fix some parenthesis opened at end of line.

It looks like this is all guarded by #ifdef UDC_DEBUG_DUMP
which is not ever set and this probably would not compile
if it was.

It's probably better to remove all the blocks guarded by
that flag and the flag itself.

> Signed-off-by: Cristian Sicilia 
> ---
>  drivers/staging/emxx_udc/emxx_udc.c | 73 
> ++---
>  1 file changed, 36 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
> b/drivers/staging/emxx_udc/emxx_udc.c
> index bf7c5da..26bd77c 100644
> --- a/drivers/staging/emxx_udc/emxx_udc.c
> +++ b/drivers/staging/emxx_udc/emxx_udc.c
> @@ -108,20 +108,20 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc 
> *udc)
>  
>   dev_dbg(>dev, "\n-USB REG-\n");
>   for (i = 0x0 ; i < USB_BASE_SIZE ; i += 16) {
> - reg_data =   _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i));
>   dev_dbg(>dev, "USB%04x =%08x", i, (int)reg_data);
>  
> - reg_data =  _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 4));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i + 4));
>   dev_dbg(>dev, " %08x", (int)reg_data);
>  
> - reg_data =  _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 8));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i + 8));
>   dev_dbg(>dev, " %08x", (int)reg_data);
>  
> - reg_data =  _nbu2ss_readl(
> - (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 12));
> + reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
> + i + 12));
>   dev_dbg(>dev, " %08x\n", (int)reg_data);
>   }
>  
> @@ -473,22 +473,23 @@ static void _nbu2ss_dma_map_single(
>   if (req->unaligned) {
>   req->req.dma = ep->phys_buf;
>   } else {
> - req->req.dma = dma_map_single(
> - udc->gadget.dev.parent,
> - req->req.buf,
> - req->req.length,
> - (direct == USB_DIR_IN)
> - ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
> + req->req.dma =
> + dma_map_single(udc->gadget.dev.parent,
> +req->req.buf,
> +req->req.length,
> +(direct == USB_DIR_IN) ?
> + DMA_TO_DEVICE :
> + DMA_FROM_DEVICE);
>   }
>   req->mapped = 1;
>   } else {
>   if (!req->unaligned)
> - dma_sync_single_for_device(
> - udc->gadget.dev.parent,
> - req->req.dma,
> - req->req.length,
> - (direct == USB_DIR_IN)
> - ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
> + dma_sync_single_for_device(udc->gadget.dev.parent,
> +req->req.dma,
> +req->req.length,
> +(direct == USB_DIR_IN)
> + ? DMA_TO_DEVICE :
> + DMA_FROM_DEVICE);
>  
>   req->mapped = 0;
>   }
> @@ -975,8 +976,8 @@ static int _nbu2ss_epn_out_transfer(
>  
>   /*-*/
>   /* Receive Length */
> - i_recv_length
> - = _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
> + i_recv_length =
> + _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
>  
>   if (i_recv_length != 0) {
>   result = _nbu2ss_epn_out_data(udc, ep, req, i_recv_length);
> @@ -1115,10 +1116,9 @@ static int _nbu2ss_epn_in_pio(
>   i_word_length = length / sizeof(u32);
>   if (i_word_length > 0) {
>   for (i = 0; i < i_word_length; i++) {
> - _nbu2ss_writel(
> - >EP_REGS[ep->epnum - 1].EP_WRITE
> - , p_buf_32->dw
> - );
> + _nbu2ss_writel(>EP_REGS[ep->epnum -
> +   1].EP_WRITE,
> +

[PATCH 1/2] staging: emxx_udc: Split line and fix eol parenthesis

2018-11-16 Thread Cristian Sicilia
Fix some parenthesis opened at end of line.

Signed-off-by: Cristian Sicilia 
---
 drivers/staging/emxx_udc/emxx_udc.c | 73 ++---
 1 file changed, 36 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index bf7c5da..26bd77c 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -108,20 +108,20 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc)
 
dev_dbg(>dev, "\n-USB REG-\n");
for (i = 0x0 ; i < USB_BASE_SIZE ; i += 16) {
-   reg_data =   _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i));
dev_dbg(>dev, "USB%04x =%08x", i, (int)reg_data);
 
-   reg_data =  _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 4));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i + 4));
dev_dbg(>dev, " %08x", (int)reg_data);
 
-   reg_data =  _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 8));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i + 8));
dev_dbg(>dev, " %08x", (int)reg_data);
 
-   reg_data =  _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 12));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i + 12));
dev_dbg(>dev, " %08x\n", (int)reg_data);
}
 
@@ -473,22 +473,23 @@ static void _nbu2ss_dma_map_single(
if (req->unaligned) {
req->req.dma = ep->phys_buf;
} else {
-   req->req.dma = dma_map_single(
-   udc->gadget.dev.parent,
-   req->req.buf,
-   req->req.length,
-   (direct == USB_DIR_IN)
-   ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+   req->req.dma =
+   dma_map_single(udc->gadget.dev.parent,
+  req->req.buf,
+  req->req.length,
+  (direct == USB_DIR_IN) ?
+   DMA_TO_DEVICE :
+   DMA_FROM_DEVICE);
}
req->mapped = 1;
} else {
if (!req->unaligned)
-   dma_sync_single_for_device(
-   udc->gadget.dev.parent,
-   req->req.dma,
-   req->req.length,
-   (direct == USB_DIR_IN)
-   ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+   dma_sync_single_for_device(udc->gadget.dev.parent,
+  req->req.dma,
+  req->req.length,
+  (direct == USB_DIR_IN)
+   ? DMA_TO_DEVICE :
+   DMA_FROM_DEVICE);
 
req->mapped = 0;
}
@@ -975,8 +976,8 @@ static int _nbu2ss_epn_out_transfer(
 
/*-*/
/* Receive Length */
-   i_recv_length
-   = _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
+   i_recv_length =
+   _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
 
if (i_recv_length != 0) {
result = _nbu2ss_epn_out_data(udc, ep, req, i_recv_length);
@@ -1115,10 +1116,9 @@ static int _nbu2ss_epn_in_pio(
i_word_length = length / sizeof(u32);
if (i_word_length > 0) {
for (i = 0; i < i_word_length; i++) {
-   _nbu2ss_writel(
-   >EP_REGS[ep->epnum - 1].EP_WRITE
-   , p_buf_32->dw
-   );
+   _nbu2ss_writel(>EP_REGS[ep->epnum -
+ 1].EP_WRITE,
+  p_buf_32->dw);
 
p_buf_32++;
}
@@ -1472,13 +1472,11 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc 
*udc, bool bset)
if (0x == (wIndex & 0xFF70)) {
if (selector == 

[PATCH 1/2] staging: emxx_udc: Split line and fix eol parenthesis

2018-11-16 Thread Cristian Sicilia
Fix some parenthesis opened at end of line.

Signed-off-by: Cristian Sicilia 
---
 drivers/staging/emxx_udc/emxx_udc.c | 73 ++---
 1 file changed, 36 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index bf7c5da..26bd77c 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -108,20 +108,20 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc)
 
dev_dbg(>dev, "\n-USB REG-\n");
for (i = 0x0 ; i < USB_BASE_SIZE ; i += 16) {
-   reg_data =   _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i));
dev_dbg(>dev, "USB%04x =%08x", i, (int)reg_data);
 
-   reg_data =  _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 4));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i + 4));
dev_dbg(>dev, " %08x", (int)reg_data);
 
-   reg_data =  _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 8));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i + 8));
dev_dbg(>dev, " %08x", (int)reg_data);
 
-   reg_data =  _nbu2ss_readl(
-   (u32 *)IO_ADDRESS(USB_BASE_ADDRESS + i + 12));
+   reg_data = _nbu2ss_readl((u32 *)IO_ADDRESS(USB_BASE_ADDRESS +
+   i + 12));
dev_dbg(>dev, " %08x\n", (int)reg_data);
}
 
@@ -473,22 +473,23 @@ static void _nbu2ss_dma_map_single(
if (req->unaligned) {
req->req.dma = ep->phys_buf;
} else {
-   req->req.dma = dma_map_single(
-   udc->gadget.dev.parent,
-   req->req.buf,
-   req->req.length,
-   (direct == USB_DIR_IN)
-   ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+   req->req.dma =
+   dma_map_single(udc->gadget.dev.parent,
+  req->req.buf,
+  req->req.length,
+  (direct == USB_DIR_IN) ?
+   DMA_TO_DEVICE :
+   DMA_FROM_DEVICE);
}
req->mapped = 1;
} else {
if (!req->unaligned)
-   dma_sync_single_for_device(
-   udc->gadget.dev.parent,
-   req->req.dma,
-   req->req.length,
-   (direct == USB_DIR_IN)
-   ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+   dma_sync_single_for_device(udc->gadget.dev.parent,
+  req->req.dma,
+  req->req.length,
+  (direct == USB_DIR_IN)
+   ? DMA_TO_DEVICE :
+   DMA_FROM_DEVICE);
 
req->mapped = 0;
}
@@ -975,8 +976,8 @@ static int _nbu2ss_epn_out_transfer(
 
/*-*/
/* Receive Length */
-   i_recv_length
-   = _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
+   i_recv_length =
+   _nbu2ss_readl(>EP_REGS[num].EP_LEN_DCNT) & EPN_LDATA;
 
if (i_recv_length != 0) {
result = _nbu2ss_epn_out_data(udc, ep, req, i_recv_length);
@@ -1115,10 +1116,9 @@ static int _nbu2ss_epn_in_pio(
i_word_length = length / sizeof(u32);
if (i_word_length > 0) {
for (i = 0; i < i_word_length; i++) {
-   _nbu2ss_writel(
-   >EP_REGS[ep->epnum - 1].EP_WRITE
-   , p_buf_32->dw
-   );
+   _nbu2ss_writel(>EP_REGS[ep->epnum -
+ 1].EP_WRITE,
+  p_buf_32->dw);
 
p_buf_32++;
}
@@ -1472,13 +1472,11 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc 
*udc, bool bset)
if (0x == (wIndex & 0xFF70)) {
if (selector ==