crypto: qce - simplify qce_handle_request

Simplify the for loop's control flow and return the results directly.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Thorsten Blum
2026-07-31 12:25:33 +02:00
committed by Herbert Xu
parent bf3285b7a7
commit ebd1071c21

View File

@@ -71,19 +71,17 @@ static int devm_qce_register_algs(struct qce_device *qce)
static int qce_handle_request(struct crypto_async_request *async_req)
{
int ret = -EINVAL, i;
int i;
const struct qce_algo_ops *ops;
u32 type = crypto_tfm_alg_type(async_req->tfm);
for (i = 0; i < ARRAY_SIZE(qce_ops); i++) {
ops = qce_ops[i];
if (type != ops->type)
continue;
ret = ops->async_req_handle(async_req);
break;
if (type == ops->type)
return ops->async_req_handle(async_req);
}
return ret;
return -EINVAL;
}
static int qce_handle_queue(struct qce_device *qce,