diff mbox

staging: crypto: fixed style error in aead.c

Message ID 1417757084-32155-1-git-send-email-Joshua@cybercrimetech.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Joshua I. James Dec. 5, 2014, 5:24 a.m. UTC
From: "Joshua I. James" <joshua@cybercrimetech.com>

Fixed style error identified by checkpatch.

ERROR: do not use assignment in if condition
+       if ((err = crypto_register_instance(tmpl, inst))) {

Signed-off-by: Joshua I. James <joshua@cybercrimetech.com>
---
 crypto/aead.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jason Cooper Dec. 5, 2014, 1:47 p.m. UTC | #1
Joshua,

On Fri, Dec 05, 2014 at 02:24:44PM +0900, Joshua I. James wrote:
> From: "Joshua I. James" <joshua@cybercrimetech.com>
> 
> Fixed style error identified by checkpatch.
> 
> ERROR: do not use assignment in if condition
> +       if ((err = crypto_register_instance(tmpl, inst))) {

Short comment needed here like I mentioned with the first patch.  Also,
subject line needs corrected as with the first.

> 
> Signed-off-by: Joshua I. James <joshua@cybercrimetech.com>
> ---
>  crypto/aead.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/crypto/aead.c b/crypto/aead.c
> index 547491e..2222710 100644
> --- a/crypto/aead.c
> +++ b/crypto/aead.c
> @@ -448,7 +448,8 @@ static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask)
>  	if (IS_ERR(inst))
>  		goto put_tmpl;
>  
> -	if ((err = crypto_register_instance(tmpl, inst))) {
> +	err = crypto_register_instance(tmpl, inst);
> +	if (err) {
>  		tmpl->free(inst);
>  		goto put_tmpl;
>  	}

I haven't looked at the rest of the series yet, but if they are just
like this one, Herbert may prefer just to put these all in one patch.
I'll add him to the To: and you should wait for his response.

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/crypto/aead.c b/crypto/aead.c
index 547491e..2222710 100644
--- a/crypto/aead.c
+++ b/crypto/aead.c
@@ -448,7 +448,8 @@  static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask)
 	if (IS_ERR(inst))
 		goto put_tmpl;
 
-	if ((err = crypto_register_instance(tmpl, inst))) {
+	err = crypto_register_instance(tmpl, inst);
+	if (err) {
 		tmpl->free(inst);
 		goto put_tmpl;
 	}