Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "Geyslan G. Bem" <geyslan@gmail.com>
To: kernel-br@googlegroups.com
Cc: "Geyslan G. Bem" <geyslan@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org (open list:CRYPTO API),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] crypto: n2_core: insert '!err' condition in else scope
Date: Sat, 19 Oct 2013 10:09:31 -0300	[thread overview]
Message-ID: <1382188171-25595-1-git-send-email-geyslan@gmail.com> (raw)

This patch moves the '!err' condition into the above else scope,
what is more obvious and has the secondary goal of avoid false-positives
in statical analyze tools.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/crypto/n2_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index e1f0ab4..afc6983 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -1511,9 +1511,9 @@ static int __n2_register_one_ahash(const struct n2_hash_tmpl *tmpl)
 		kfree(p);
 	} else {
 		pr_info("%s alg registered\n", base->cra_name);
+		if (p->hmac_type != AUTH_TYPE_RESERVED)
+			err = __n2_register_one_hmac(p);
 	}
-	if (!err && p->hmac_type != AUTH_TYPE_RESERVED)
-		err = __n2_register_one_hmac(p);
 	return err;
 }
 
-- 
1.8.4

             reply	other threads:[~2013-10-19 13:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-19 13:09 Geyslan G. Bem [this message]
2013-10-19 22:38 ` [PATCH] crypto: n2_core: insert '!err' condition in else scope David Miller
2013-10-19 22:42   ` Geyslan Gregório Bem
2013-10-19 22:49     ` David Miller
2013-10-19 23:13       ` Geyslan Gregório Bem
2013-10-20 12:12         ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382188171-25595-1-git-send-email-geyslan@gmail.com \
    --to=geyslan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel-br@googlegroups.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox