[PATCH 2/2] crypto: qce - simplify qce_handle_request

From: Thorsten Blum

Date: Fri Jul 31 2026 - 06:33:10 EST


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

Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
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 a848fd58a354..dc05f2b9d52e 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -68,19 +68,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,