* [PATCH] crypto: qce - simplify control flow in register functions
@ 2026-08-15 15:09 Thorsten Blum
2026-08-26 14:58 ` Bartosz Golaszewski
2026-09-04 10:01 ` Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-08-15 15:09 UTC (permalink / raw)
To: Bartosz Golaszewski, Herbert Xu, David S. Miller
Cc: Thorsten Blum, linux-crypto, linux-arm-msm, linux-kernel
Remove the goto statements and handle errors directly to simplify the
control flow in qce_aead_register(), qce_ahash_register(), and
qce_skcipher_register().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/crypto/qce/aead.c | 9 ++++-----
drivers/crypto/qce/sha.c | 9 ++++-----
drivers/crypto/qce/skcipher.c | 9 ++++-----
3 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c
index 1647d2329982..db2e2d7bfd07 100644
--- a/drivers/crypto/qce/aead.c
+++ b/drivers/crypto/qce/aead.c
@@ -829,14 +829,13 @@ static int qce_aead_register(struct qce_device *qce)
for (i = 0; i < ARRAY_SIZE(aead_def); i++) {
ret = qce_aead_register_one(&aead_def[i], qce);
- if (ret)
- goto err;
+ if (ret) {
+ qce_aead_unregister(qce);
+ return ret;
+ }
}
return 0;
-err:
- qce_aead_unregister(qce);
- return ret;
}
const struct qce_algo_ops aead_ops = {
diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c
index 87071f315088..915ba2dcc660 100644
--- a/drivers/crypto/qce/sha.c
+++ b/drivers/crypto/qce/sha.c
@@ -527,14 +527,13 @@ static int qce_ahash_register(struct qce_device *qce)
for (i = 0; i < ARRAY_SIZE(ahash_def); i++) {
ret = qce_ahash_register_one(&ahash_def[i], qce);
- if (ret)
- goto err;
+ if (ret) {
+ qce_ahash_unregister(qce);
+ return ret;
+ }
}
return 0;
-err:
- qce_ahash_unregister(qce);
- return ret;
}
const struct qce_algo_ops ahash_ops = {
diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c
index b9a931037fdc..6e6c5f4b33a5 100644
--- a/drivers/crypto/qce/skcipher.c
+++ b/drivers/crypto/qce/skcipher.c
@@ -511,14 +511,13 @@ static int qce_skcipher_register(struct qce_device *qce)
for (i = 0; i < ARRAY_SIZE(skcipher_def); i++) {
ret = qce_skcipher_register_one(&skcipher_def[i], qce);
- if (ret)
- goto err;
+ if (ret) {
+ qce_skcipher_unregister(qce);
+ return ret;
+ }
}
return 0;
-err:
- qce_skcipher_unregister(qce);
- return ret;
}
const struct qce_algo_ops skcipher_ops = {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: qce - simplify control flow in register functions
2026-08-15 15:09 [PATCH] crypto: qce - simplify control flow in register functions Thorsten Blum
@ 2026-08-26 14:58 ` Bartosz Golaszewski
2026-09-04 10:01 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2026-08-26 14:58 UTC (permalink / raw)
To: Thorsten Blum
Cc: linux-crypto, linux-arm-msm, linux-kernel, Bartosz Golaszewski,
Herbert Xu, David S. Miller
On Sat, 15 Aug 2026 17:09:47 +0200, Thorsten Blum
<thorsten.blum@linux.dev> said:
> Remove the goto statements and handle errors directly to simplify the
> control flow in qce_aead_register(), qce_ahash_register(), and
> qce_skcipher_register().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: qce - simplify control flow in register functions
2026-08-15 15:09 [PATCH] crypto: qce - simplify control flow in register functions Thorsten Blum
2026-08-26 14:58 ` Bartosz Golaszewski
@ 2026-09-04 10:01 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2026-09-04 10:01 UTC (permalink / raw)
To: Thorsten Blum
Cc: Bartosz Golaszewski, David S. Miller, linux-crypto,
linux-arm-msm, linux-kernel
On Sat, Aug 15, 2026 at 05:09:47PM +0200, Thorsten Blum wrote:
> Remove the goto statements and handle errors directly to simplify the
> control flow in qce_aead_register(), qce_ahash_register(), and
> qce_skcipher_register().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/crypto/qce/aead.c | 9 ++++-----
> drivers/crypto/qce/sha.c | 9 ++++-----
> drivers/crypto/qce/skcipher.c | 9 ++++-----
> 3 files changed, 12 insertions(+), 15 deletions(-)
Patch applied. Thanks.
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-04 10:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-15 15:09 [PATCH] crypto: qce - simplify control flow in register functions Thorsten Blum
2026-08-26 14:58 ` Bartosz Golaszewski
2026-09-04 10:01 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®