From: Zhiqi Song songzhiqi1@huawei.com
Remove redundant index parameter of async_pause_job(), as the value of the index has been saved in async_op type variable.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- src/uadk_async.c | 8 ++++---- src/uadk_async.h | 2 +- src/uadk_cipher.c | 2 +- src/uadk_dh.c | 4 ++-- src/uadk_digest.c | 2 +- src/uadk_pkey.c | 2 +- src/uadk_rsa.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/uadk_async.c b/src/uadk_async.c index 45f3918..870065d 100644 --- a/src/uadk_async.c +++ b/src/uadk_async.c @@ -234,14 +234,14 @@ out: return ret; }
-static int async_add_poll_task(void *ctx, struct async_op *op, enum task_type type, int id) +static int async_add_poll_task(void *ctx, struct async_op *op, enum task_type type) { struct async_poll_task *task_queue; struct async_poll_task *task; int ret;
task_queue = poll_queue.head; - task = &task_queue[id]; + task = &task_queue[op->idx]; task->ctx = ctx; task->type = type; task->op = op; @@ -253,7 +253,7 @@ static int async_add_poll_task(void *ctx, struct async_op *op, enum task_type ty return 1; }
-int async_pause_job(void *ctx, struct async_op *op, enum task_type type, int id) +int async_pause_job(void *ctx, struct async_op *op, enum task_type type) { ASYNC_WAIT_CTX *waitctx; OSSL_ASYNC_FD efd; @@ -261,7 +261,7 @@ int async_pause_job(void *ctx, struct async_op *op, enum task_type type, int id) uint64_t buf; int ret;
- ret = async_add_poll_task(ctx, op, type, id); + ret = async_add_poll_task(ctx, op, type); if (ret == 0) return ret;
diff --git a/src/uadk_async.h b/src/uadk_async.h index 9160c98..1208c30 100644 --- a/src/uadk_async.h +++ b/src/uadk_async.h @@ -72,7 +72,7 @@ struct async_poll_queue {
int async_setup_async_event_notification(struct async_op *op); int async_clear_async_event_notification(void); -int async_pause_job(void *ctx, struct async_op *op, enum task_type type, int id); +int async_pause_job(void *ctx, struct async_op *op, enum task_type type); void async_register_poll_fn(int type, async_recv_t func); int async_module_init(void); int async_wake_job(ASYNC_JOB *job); diff --git a/src/uadk_cipher.c b/src/uadk_cipher.c index 901c29e..ed25787 100644 --- a/src/uadk_cipher.c +++ b/src/uadk_cipher.c @@ -841,7 +841,7 @@ static int do_cipher_async(struct cipher_priv_ctx *priv, struct async_op *op) } } while (ret == -EBUSY);
- ret = async_pause_job(priv, op, ASYNC_TASK_CIPHER, idx); + ret = async_pause_job(priv, op, ASYNC_TASK_CIPHER); if (!ret) return 0; return 1; diff --git a/src/uadk_dh.c b/src/uadk_dh.c index acb5b8a..418747e 100644 --- a/src/uadk_dh.c +++ b/src/uadk_dh.c @@ -723,12 +723,12 @@ static int dh_do_crypto(struct uadk_dh_sess *dh_sess) do { ret = wd_do_dh_async(dh_sess->sess, &dh_sess->req); if (ret < 0 && ret != -EBUSY) { - async_free_poll_task(idx, 0); + async_free_poll_task(op.idx, 0); goto err; } } while (ret == -EBUSY);
- ret = async_pause_job(dh_sess, &op, ASYNC_TASK_DH, idx); + ret = async_pause_job(dh_sess, &op, ASYNC_TASK_DH); if (!ret) goto err;
diff --git a/src/uadk_digest.c b/src/uadk_digest.c index beb9f51..fa96e57 100644 --- a/src/uadk_digest.c +++ b/src/uadk_digest.c @@ -757,7 +757,7 @@ static int do_digest_async(struct digest_priv_ctx *priv, struct async_op *op) } } while (ret == -EBUSY);
- ret = async_pause_job(priv, op, ASYNC_TASK_DIGEST, idx); + ret = async_pause_job(priv, op, ASYNC_TASK_DIGEST); if (!ret) return 0; return 1; diff --git a/src/uadk_pkey.c b/src/uadk_pkey.c index 60e3238..b071d8b 100644 --- a/src/uadk_pkey.c +++ b/src/uadk_pkey.c @@ -312,7 +312,7 @@ int uadk_ecc_crypto(handle_t sess, struct wd_ecc_req *req, void *usr) } } while (ret == -EBUSY);
- ret = async_pause_job((void *)usr, &op, ASYNC_TASK_ECC, idx); + ret = async_pause_job((void *)usr, &op, ASYNC_TASK_ECC); if (!ret) goto err; if (req->status) diff --git a/src/uadk_rsa.c b/src/uadk_rsa.c index d0780a7..ca05ef7 100644 --- a/src/uadk_rsa.c +++ b/src/uadk_rsa.c @@ -1118,7 +1118,7 @@ static int rsa_do_crypto(struct uadk_rsa_sess *rsa_sess) } } while (ret == -EBUSY);
- ret = async_pause_job(rsa_sess, &op, ASYNC_TASK_RSA, idx); + ret = async_pause_job(rsa_sess, &op, ASYNC_TASK_RSA); if (!ret) goto err;