From: Nicholas Mc Guire <der.herr@hofr.at>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-kernel@vger.kernel.org,
Russell King <linux@armlinux.org.uk>,
Nicholas Mc Guire <der.herr@hofr.at>,
linux-crypto@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] crypto: arm/aes-ce: assign err return conditionally
Date: Wed, 8 Feb 2017 14:36:19 +0100 [thread overview]
Message-ID: <1486560979-25240-1-git-send-email-der.herr@hofr.at> (raw)
As the err value is not used unless there was an error it can be assigned
conditionally here.
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
Not sure if this is really relevant and worth changing, effectively it
is practically no change as gcc would move the err = PTR_ERR(simd);
below unregister_simds: anyway (based on inspection of .lst/.s files)
- so it is more of an adjust C-level to object level for readability.
Patch was compile-tested with multi_v7_defconfig
(implies CONFIG_CRYPTO_AES_ARM_CE=m)
Patch is against 4.10-rc7 (localversion-next is next-20170208)
arch/arm/crypto/aes-ce-glue.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/crypto/aes-ce-glue.c b/arch/arm/crypto/aes-ce-glue.c
index 883b84d..8f65030 100644
--- a/arch/arm/crypto/aes-ce-glue.c
+++ b/arch/arm/crypto/aes-ce-glue.c
@@ -437,9 +437,10 @@ static int __init aes_init(void)
drvname = aes_algs[i].base.cra_driver_name + 2;
basename = aes_algs[i].base.cra_driver_name;
simd = simd_skcipher_create_compat(algname, drvname, basename);
- err = PTR_ERR(simd);
- if (IS_ERR(simd))
+ if (IS_ERR(simd)) {
+ err = PTR_ERR(simd);
goto unregister_simds;
+ }
aes_simd_algs[i] = simd;
}
--
2.1.4
next reply other threads:[~2017-02-08 13:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 13:36 Nicholas Mc Guire [this message]
2017-02-11 9:39 ` [PATCH] crypto: arm/aes-ce: assign err return conditionally Herbert Xu
2017-02-11 10:15 ` Nicholas Mc Guire
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=1486560979-25240-1-git-send-email-der.herr@hofr.at \
--to=der.herr@hofr.at \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).