diff mbox series

crypto: hisilicon: remove redundant assignment of pointer ctx

Message ID 20200222142409.141057-1-colin.king@canonical.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: hisilicon: remove redundant assignment of pointer ctx | expand

Commit Message

Colin King Feb. 22, 2020, 2:24 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Pointer ctx is being re-assigned with the same value as it
was initialized with. The second assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/crypto/hisilicon/sec2/sec_crypto.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Xu Zaibo Feb. 24, 2020, 1:14 a.m. UTC | #1
Yes, thank you!


On 2020/2/22 22:24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer ctx is being re-assigned with the same value as it
> was initialized with. The second assignment is redundant and
> can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/crypto/hisilicon/sec2/sec_crypto.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
> index a2cfcc9ccd94..acd15507eb8a 100644
> --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
> +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
> @@ -447,7 +447,6 @@ static int sec_skcipher_init(struct crypto_skcipher *tfm)
>   	struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
>   	int ret;
>   
> -	ctx = crypto_skcipher_ctx(tfm);
>   	ctx->alg_type = SEC_SKCIPHER;
>   	crypto_skcipher_set_reqsize(tfm, sizeof(struct sec_req));
>   	ctx->c_ctx.ivsize = crypto_skcipher_ivsize(tfm);
Herbert Xu Feb. 28, 2020, 12:53 a.m. UTC | #2
On Sat, Feb 22, 2020 at 02:24:09PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer ctx is being re-assigned with the same value as it
> was initialized with. The second assignment is redundant and
> can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/crypto/hisilicon/sec2/sec_crypto.c | 1 -
>  1 file changed, 1 deletion(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index a2cfcc9ccd94..acd15507eb8a 100644
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
@@ -447,7 +447,6 @@  static int sec_skcipher_init(struct crypto_skcipher *tfm)
 	struct sec_ctx *ctx = crypto_skcipher_ctx(tfm);
 	int ret;
 
-	ctx = crypto_skcipher_ctx(tfm);
 	ctx->alg_type = SEC_SKCIPHER;
 	crypto_skcipher_set_reqsize(tfm, sizeof(struct sec_req));
 	ctx->c_ctx.ivsize = crypto_skcipher_ivsize(tfm);