mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine/trivial: at_hdmac: add curly brackets to if/else expressions
@ 2013-06-07 15:28 Nicolas Ferre
  2013-06-07 15:38 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Ferre @ 2013-06-07 15:28 UTC (permalink / raw)
  To: Arnd Bergmann, Vinod Koul
  Cc: Ludovic Desroches, linux-arm-kernel, linux-kernel, Nicolas Ferre

Correct coding style following the patch:
7c407d3e54dcc0c79119553c8d5ef176c1d5bc3a (DMA: AT91:
Get residual bytes in dma buffer).

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/dma/at_hdmac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 50953a7..b321562 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -299,8 +299,9 @@ static int atc_get_bytes_left(struct dma_chan *chan)
 		if (atchan->remain_desc < 0) {
 			ret = -EINVAL;
 			goto out;
-		} else
+		} else {
 			ret = atchan->remain_desc;
+		}
 	} else {
 		/*
 		 * Get residual bytes when current
@@ -1120,8 +1121,9 @@ atc_tx_status(struct dma_chan *chan,
 	if (unlikely(bytes < 0)) {
 		dev_vdbg(chan2dev(chan), "get residual bytes error\n");
 		return DMA_ERROR;
-	} else
+	} else {
 		dma_set_residue(txstate, bytes);
+	}
 
 	dev_vdbg(chan2dev(chan), "tx_status %d: cookie = %d residue = %d\n",
 		 ret, cookie, bytes);
-- 
1.8.2.2


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

* Re: [PATCH] dmaengine/trivial: at_hdmac: add curly brackets to if/else expressions
  2013-06-07 15:28 [PATCH] dmaengine/trivial: at_hdmac: add curly brackets to if/else expressions Nicolas Ferre
@ 2013-06-07 15:38 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2013-06-07 15:38 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Vinod Koul, Ludovic Desroches, linux-arm-kernel, linux-kernel

On Friday 07 June 2013, Nicolas Ferre wrote:
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 50953a7..b321562 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -299,8 +299,9 @@ static int atc_get_bytes_left(struct dma_chan *chan)
>                 if (atchan->remain_desc < 0) {
>                         ret = -EINVAL;
>                         goto out;
> -               } else
> +               } else {
>                         ret = atchan->remain_desc;
> +               }
>         } else {

Actually the original code is what a lot of people prefer, though I don't
have a reference to back that up.

If one side of the 'else' uses curly braces, the other one should too.
	
	Arnd

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

end of thread, other threads:[~2013-06-07 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 15:28 [PATCH] dmaengine/trivial: at_hdmac: add curly brackets to if/else expressions Nicolas Ferre
2013-06-07 15:38 ` Arnd Bergmann

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

Powered by JetHome