mirror of
https://github.com/torvalds/linux.git
synced 2026-11-09 13:44:03 +01:00
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:
parent
aacc136b89
commit
844de21437
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user