2022-09-02 07:33:03

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] crypto: nx - Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value set_msg_len() directly instead of storing it in another
redundant variable.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: ye xingchen <[email protected]>
---
drivers/crypto/nx/nx-aes-ccm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c
index 3793885f928d..c843f4c6f684 100644
--- a/drivers/crypto/nx/nx-aes-ccm.c
+++ b/drivers/crypto/nx/nx-aes-ccm.c
@@ -134,7 +134,6 @@ static int generate_b0(u8 *iv, unsigned int assoclen, unsigned int authsize,
unsigned int cryptlen, u8 *b0)
{
unsigned int l, lp, m = authsize;
- int rc;

memcpy(b0, iv, 16);

@@ -148,9 +147,7 @@ static int generate_b0(u8 *iv, unsigned int assoclen, unsigned int authsize,
if (assoclen)
*b0 |= 64;

- rc = set_msg_len(b0 + 16 - l, cryptlen, l);
-
- return rc;
+ return set_msg_len(b0 + 16 - l, cryptlen, l);
}

static int generate_pat(u8 *iv,
--
2.25.1


2022-09-09 09:10:28

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH linux-next] crypto: nx - Remove the unneeded result variable

On Fri, Sep 02, 2022 at 07:30:55AM +0000, [email protected] wrote:
> From: ye xingchen <[email protected]>
>
> Return the value set_msg_len() directly instead of storing it in another
> redundant variable.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: ye xingchen <[email protected]>
> ---
> drivers/crypto/nx/nx-aes-ccm.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt