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

Thorsten Blum <[email protected]>
Newsgroups org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-crypto,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Simplify the for loop's control flow and return the results directly.

Signed-off-by: Thorsten Blum <[email protected]>
---
 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,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.