OSDN Git Service

crypto: ccp - Make use of the helper macro kthread_run()
authorCai Huoqing <caihuoqing@baidu.com>
Thu, 21 Oct 2021 08:38:54 +0000 (16:38 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 Oct 2021 13:04:04 +0000 (21:04 +0800)
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>
drivers/crypto/ccp/ccp-dev-v3.c
drivers/crypto/ccp/ccp-dev-v5.c

index 0d5576f..fe69053 100644 (file)
@@ -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));
@@ -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");
index 7838f63..7b73332 100644 (file)
@@ -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));
@@ -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");