mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
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:
committed by
Herbert Xu
parent
bf3285b7a7
commit
ebd1071c21
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user