crypto: qce - simplify control flow in register functions

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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Thorsten Blum 2026-08-15 17:09:47 +02:00 committed by Herbert Xu
parent aacc136b89
commit 844de21437
3 changed files with 12 additions and 15 deletions

View File

@ -769,14 +769,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 = {

View File

@ -480,14 +480,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 = {

View File

@ -416,14 +416,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 = {