All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: marvell/cesa: Improving code readability
@ 2016-04-19 15:09 Romain Perier
  2016-04-19 15:19 ` Boris Brezillon
  2016-04-20 10:01 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Romain Perier @ 2016-04-19 15:09 UTC (permalink / raw)
  To: Boris Brezillon, Arnaud Ebalard
  Cc: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Thomas Petazzoni, Nadav Haklai, Ofer Heifetz,
	linux-crypto

When looking for available engines, the variable "engine" is
assigned to "&cesa->engines[i]" at the beginning of the for loop. Replacing
next occurences of "&cesa->engines[i]" by "engine" and in order to improve
readability.

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---
 drivers/crypto/marvell/cesa.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c
index 80239ae..e8ef9fd 100644
--- a/drivers/crypto/marvell/cesa.c
+++ b/drivers/crypto/marvell/cesa.c
@@ -475,18 +475,18 @@ static int mv_cesa_probe(struct platform_device *pdev)
 		engine->regs = cesa->regs + CESA_ENGINE_OFF(i);
 
 		if (dram && cesa->caps->has_tdma)
-			mv_cesa_conf_mbus_windows(&cesa->engines[i], dram);
+			mv_cesa_conf_mbus_windows(engine, dram);
 
-		writel(0, cesa->engines[i].regs + CESA_SA_INT_STATUS);
+		writel(0, engine->regs + CESA_SA_INT_STATUS);
 		writel(CESA_SA_CFG_STOP_DIG_ERR,
-		       cesa->engines[i].regs + CESA_SA_CFG);
+		       engine->regs + CESA_SA_CFG);
 		writel(engine->sram_dma & CESA_SA_SRAM_MSK,
-		       cesa->engines[i].regs + CESA_SA_DESC_P0);
+		       engine->regs + CESA_SA_DESC_P0);
 
 		ret = devm_request_threaded_irq(dev, irq, NULL, mv_cesa_int,
 						IRQF_ONESHOT,
 						dev_name(&pdev->dev),
-						&cesa->engines[i]);
+						engine);
 		if (ret)
 			goto err_cleanup;
 	}
-- 
2.8.0

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

* Re: [PATCH] crypto: marvell/cesa: Improving code readability
  2016-04-19 15:09 [PATCH] crypto: marvell/cesa: Improving code readability Romain Perier
@ 2016-04-19 15:19 ` Boris Brezillon
  2016-04-20 10:01 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2016-04-19 15:19 UTC (permalink / raw)
  To: Romain Perier
  Cc: Arnaud Ebalard, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	Gregory Clement, Thomas Petazzoni, Nadav Haklai, Ofer Heifetz,
	linux-crypto

On Tue, 19 Apr 2016 17:09:20 +0200
Romain Perier <romain.perier@free-electrons.com> wrote:

> When looking for available engines, the variable "engine" is
> assigned to "&cesa->engines[i]" at the beginning of the for loop. Replacing
> next occurences of "&cesa->engines[i]" by "engine" and in order to improve
> readability.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/crypto/marvell/cesa.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c
> index 80239ae..e8ef9fd 100644
> --- a/drivers/crypto/marvell/cesa.c
> +++ b/drivers/crypto/marvell/cesa.c
> @@ -475,18 +475,18 @@ static int mv_cesa_probe(struct platform_device *pdev)
>  		engine->regs = cesa->regs + CESA_ENGINE_OFF(i);
>  
>  		if (dram && cesa->caps->has_tdma)
> -			mv_cesa_conf_mbus_windows(&cesa->engines[i], dram);
> +			mv_cesa_conf_mbus_windows(engine, dram);
>  
> -		writel(0, cesa->engines[i].regs + CESA_SA_INT_STATUS);
> +		writel(0, engine->regs + CESA_SA_INT_STATUS);
>  		writel(CESA_SA_CFG_STOP_DIG_ERR,
> -		       cesa->engines[i].regs + CESA_SA_CFG);
> +		       engine->regs + CESA_SA_CFG);
>  		writel(engine->sram_dma & CESA_SA_SRAM_MSK,
> -		       cesa->engines[i].regs + CESA_SA_DESC_P0);
> +		       engine->regs + CESA_SA_DESC_P0);
>  
>  		ret = devm_request_threaded_irq(dev, irq, NULL, mv_cesa_int,
>  						IRQF_ONESHOT,
>  						dev_name(&pdev->dev),
> -						&cesa->engines[i]);
> +						engine);
>  		if (ret)
>  			goto err_cleanup;
>  	}



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* Re: [PATCH] crypto: marvell/cesa: Improving code readability
  2016-04-19 15:09 [PATCH] crypto: marvell/cesa: Improving code readability Romain Perier
  2016-04-19 15:19 ` Boris Brezillon
@ 2016-04-20 10:01 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2016-04-20 10:01 UTC (permalink / raw)
  To: Romain Perier
  Cc: boris.brezillon, arno, jason, andrew, sebastian.hesselbarth,
	gregory.clement, thomas.petazzoni, nadavh, oferh, linux-crypto

Romain Perier <romain.perier@free-electrons.com> wrote:
> When looking for available engines, the variable "engine" is
> assigned to "&cesa->engines[i]" at the beginning of the for loop. Replacing
> next occurences of "&cesa->engines[i]" by "engine" and in order to improve
> readability.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2016-04-20 10:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19 15:09 [PATCH] crypto: marvell/cesa: Improving code readability Romain Perier
2016-04-19 15:19 ` Boris Brezillon
2016-04-20 10:01 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.