Skip to content

Commit

Permalink
crypto: ccp - Make use of the helper macro kthread_run()
Browse files Browse the repository at this point in the history
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Cai Huoqing authored and Herbert Xu committed Oct 29, 2021
1 parent 284340a commit 83bff10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions drivers/crypto/ccp/ccp-dev-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ static int ccp_init(struct ccp_device *ccp)

cmd_q = &ccp->cmd_q[i];

kthread = kthread_create(ccp_cmd_queue_thread, cmd_q,
"%s-q%u", ccp->name, cmd_q->id);
kthread = kthread_run(ccp_cmd_queue_thread, cmd_q,
"%s-q%u", ccp->name, cmd_q->id);
if (IS_ERR(kthread)) {
dev_err(dev, "error creating queue thread (%ld)\n",
PTR_ERR(kthread));
Expand All @@ -477,7 +477,6 @@ static int ccp_init(struct ccp_device *ccp)
}

cmd_q->kthread = kthread;
wake_up_process(kthread);
}

dev_dbg(dev, "Enabling interrupts...\n");
Expand Down
5 changes: 2 additions & 3 deletions drivers/crypto/ccp/ccp-dev-v5.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,8 @@ static int ccp5_init(struct ccp_device *ccp)

cmd_q = &ccp->cmd_q[i];

kthread = kthread_create(ccp_cmd_queue_thread, cmd_q,
"%s-q%u", ccp->name, cmd_q->id);
kthread = kthread_run(ccp_cmd_queue_thread, cmd_q,
"%s-q%u", ccp->name, cmd_q->id);
if (IS_ERR(kthread)) {
dev_err(dev, "error creating queue thread (%ld)\n",
PTR_ERR(kthread));
Expand All @@ -960,7 +960,6 @@ static int ccp5_init(struct ccp_device *ccp)
}

cmd_q->kthread = kthread;
wake_up_process(kthread);
}

dev_dbg(dev, "Enabling interrupts...\n");
Expand Down

0 comments on commit 83bff10

Please sign in to comment.