Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361626 > unrolled thread

[patch] crypto: marvell/cesa - remove unneeded condition

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-03-21 10:10 +0100
Last post2016-03-21 10:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] crypto: marvell/cesa - remove unneeded condition Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-21 10:10 +0100
    Re: [patch] crypto: marvell/cesa - remove unneeded condition Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-03-21 10:20 +0100

#1361626 — [patch] crypto: marvell/cesa - remove unneeded condition

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-03-21 10:10 +0100
Subject[patch] crypto: marvell/cesa - remove unneeded condition
Message-ID<rf40x-3pN-5@gated-at.bofh.it>
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;
 }

[toc] | [next] | [standalone]


#1361629

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-03-21 10:20 +0100
Message-ID<rf4ad-3tj-1@gated-at.bofh.it>
In reply to#1361626
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web