From ebd1071c217a6813050a5fd3561fd453ffd152f2 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Fri, 31 Jul 2026 12:25:33 +0200 Subject: [PATCH] crypto: qce - simplify qce_handle_request Simplify the for loop's control flow and return the results directly. Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- drivers/crypto/qce/core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index e8d5f5a65f00..f50bffa7e0aa 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -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,