Skip to content

Commit 8b0c436

Browse files
Gilad Ben-Yossefherbertx
authored andcommitted
crypto: ccree - cc_do_send_request() is void func
cc_do_send_request() cannot fail and always returns -EINPROGRESS. Turn it into a void function and simplify code. Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent cedca59 commit 8b0c436

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

drivers/crypto/ccree/cc_request_mgr.c

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,11 @@ static int cc_queues_status(struct cc_drvdata *drvdata,
275275
* \param len The crypto sequence length
276276
* \param add_comp If "true": add an artificial dout DMA to mark completion
277277
*
278-
* \return int Returns -EINPROGRESS or error code
279278
*/
280-
static int cc_do_send_request(struct cc_drvdata *drvdata,
281-
struct cc_crypto_req *cc_req,
282-
struct cc_hw_desc *desc, unsigned int len,
283-
bool add_comp)
279+
static void cc_do_send_request(struct cc_drvdata *drvdata,
280+
struct cc_crypto_req *cc_req,
281+
struct cc_hw_desc *desc, unsigned int len,
282+
bool add_comp)
284283
{
285284
struct cc_req_mgr_handle *req_mgr_h = drvdata->request_mgr_handle;
286285
unsigned int used_sw_slots;
@@ -328,9 +327,6 @@ static int cc_do_send_request(struct cc_drvdata *drvdata,
328327
/* Update the free slots in HW queue */
329328
req_mgr_h->q_free_slots -= total_seq_len;
330329
}
331-
332-
/* Operation still in process */
333-
return -EINPROGRESS;
334330
}
335331

336332
static void cc_enqueue_backlog(struct cc_drvdata *drvdata,
@@ -390,16 +386,10 @@ static void cc_proc_backlog(struct cc_drvdata *drvdata)
390386
return;
391387
}
392388

393-
rc = cc_do_send_request(drvdata, &bli->creq, bli->desc,
394-
bli->len, false);
395-
389+
cc_do_send_request(drvdata, &bli->creq, bli->desc, bli->len,
390+
false);
396391
spin_unlock(&mgr->hw_lock);
397392

398-
if (rc != -EINPROGRESS) {
399-
cc_pm_put_suspend(dev);
400-
creq->user_cb(dev, req, rc);
401-
}
402-
403393
/* Remove ourselves from the backlog list */
404394
spin_lock(&mgr->bl_lock);
405395
list_del(&bli->list);
@@ -452,8 +442,10 @@ int cc_send_request(struct cc_drvdata *drvdata, struct cc_crypto_req *cc_req,
452442
return -EBUSY;
453443
}
454444

455-
if (!rc)
456-
rc = cc_do_send_request(drvdata, cc_req, desc, len, false);
445+
if (!rc) {
446+
cc_do_send_request(drvdata, cc_req, desc, len, false);
447+
rc = -EINPROGRESS;
448+
}
457449

458450
spin_unlock_bh(&mgr->hw_lock);
459451
return rc;
@@ -493,14 +485,8 @@ int cc_send_sync_request(struct cc_drvdata *drvdata,
493485
reinit_completion(&drvdata->hw_queue_avail);
494486
}
495487

496-
rc = cc_do_send_request(drvdata, cc_req, desc, len, true);
488+
cc_do_send_request(drvdata, cc_req, desc, len, true);
497489
spin_unlock_bh(&mgr->hw_lock);
498-
499-
if (rc != -EINPROGRESS) {
500-
cc_pm_put_suspend(dev);
501-
return rc;
502-
}
503-
504490
wait_for_completion(&cc_req->seq_compl);
505491
return 0;
506492
}

0 commit comments

Comments
 (0)