public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] crypto: marvell/cesa - remove unneeded condition
@ 2016-03-21  9:03 Dan Carpenter
  2016-03-21  9:10 ` Boris Brezillon
  2016-04-05 12:46 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-03-21  9:03 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Arnaud Ebalard, Herbert Xu, David S. Miller, linux-crypto,
	linux-kernel, kernel-janitors

creq->cache[] is an array inside the struct, it's not a pointer and it
can't be NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c
index 7ca2e0f..7a5058d 100644
--- a/drivers/crypto/marvell/hash.c
+++ b/drivers/crypto/marvell/hash.c
@@ -768,8 +768,7 @@ static int mv_cesa_ahash_export(struct ahash_request *req, void *hash,
 	*len = creq->len;
 	memcpy(hash, creq->state, digsize);
 	memset(cache, 0, blocksize);
-	if (creq->cache)
-		memcpy(cache, creq->cache, creq->cache_ptr);
+	memcpy(cache, creq->cache, creq->cache_ptr);
 
 	return 0;
 }

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

* Re: [patch] crypto: marvell/cesa - remove unneeded condition
  2016-03-21  9:03 [patch] crypto: marvell/cesa - remove unneeded condition Dan Carpenter
@ 2016-03-21  9:10 ` Boris Brezillon
  2016-04-05 12:46 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2016-03-21  9:10 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Arnaud Ebalard, Herbert Xu, David S. Miller, linux-crypto,
	linux-kernel, kernel-janitors

On Mon, 21 Mar 2016 12:03:43 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> creq->cache[] is an array inside the struct, it's not a pointer and it
> can't be NULL.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

> 
> diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c
> index 7ca2e0f..7a5058d 100644
> --- a/drivers/crypto/marvell/hash.c
> +++ b/drivers/crypto/marvell/hash.c
> @@ -768,8 +768,7 @@ static int mv_cesa_ahash_export(struct ahash_request *req, void *hash,
>  	*len = creq->len;
>  	memcpy(hash, creq->state, digsize);
>  	memset(cache, 0, blocksize);
> -	if (creq->cache)
> -		memcpy(cache, creq->cache, creq->cache_ptr);
> +	memcpy(cache, creq->cache, creq->cache_ptr);
>  
>  	return 0;
>  }



-- 
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 - remove unneeded condition
  2016-03-21  9:03 [patch] crypto: marvell/cesa - remove unneeded condition Dan Carpenter
  2016-03-21  9:10 ` Boris Brezillon
@ 2016-04-05 12:46 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2016-04-05 12:46 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Boris Brezillon, Arnaud Ebalard, David S. Miller, linux-crypto,
	linux-kernel, kernel-janitors

On Mon, Mar 21, 2016 at 12:03:43PM +0300, Dan Carpenter wrote:
> creq->cache[] is an array inside the struct, it's not a pointer and it
> can't be NULL.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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-05 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-21  9:03 [patch] crypto: marvell/cesa - remove unneeded condition Dan Carpenter
2016-03-21  9:10 ` Boris Brezillon
2016-04-05 12:46 ` Herbert Xu

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