Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1576637 > unrolled thread

[PATCH] crypto: arm/aes-ce: assign err return conditionally

Started byNicholas Mc Guire <der.herr@hofr.at>
First post2017-02-08 16:00 +0100
Last post2017-02-11 11:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] crypto: arm/aes-ce: assign err return conditionally Nicholas Mc Guire <der.herr@hofr.at> - 2017-02-08 16:00 +0100
    Re: [PATCH] crypto: arm/aes-ce: assign err return conditionally Herbert Xu <herbert@gondor.apana.org.au> - 2017-02-11 10:50 +0100
      Re: [PATCH] crypto: arm/aes-ce: assign err return conditionally Nicholas Mc Guire <der.herr@hofr.at> - 2017-02-11 11:20 +0100

#1576637 — [PATCH] crypto: arm/aes-ce: assign err return conditionally

FromNicholas Mc Guire <der.herr@hofr.at>
Date2017-02-08 16:00 +0100
Subject[PATCH] crypto: arm/aes-ce: assign err return conditionally
Message-ID<t8BSW-1B1-23@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1578969

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2017-02-11 10:50 +0100
Message-ID<t9Ctz-7ty-1@gated-at.bofh.it>
In reply to#1576637
On Wed, Feb 08, 2017 at 02:36:19PM +0100, Nicholas Mc Guire wrote:
> 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>

This patch just adds noise to the commit history.  So I'm not going
to apply it.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [next] | [standalone]


#1579008

FromNicholas Mc Guire <der.herr@hofr.at>
Date2017-02-11 11:20 +0100
Message-ID<t9CWB-7T5-13@gated-at.bofh.it>
In reply to#1578969
On Sat, Feb 11, 2017 at 05:39:46PM +0800, Herbert Xu wrote:
> On Wed, Feb 08, 2017 at 02:36:19PM +0100, Nicholas Mc Guire wrote:
> > 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>
> 
> This patch just adds noise to the commit history.  So I'm not going
> to apply it.

ok - I was not sure about how sensible this sort of changes are
either - will drop those code-to-object refactoring experiments
then again.

thx!
hofrat

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web