[PATCH 1/5] unisys: replace kthread_create and wake_up_process with kthread_run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Devendra Naga <devendra.aaru@xxxxxxxxx>

kthread_run calls kthread_create and if the thread is created
it then calls wake_up_process on the corresponding returned
task struct. So the code can be simplified by calling just
kthread_run.

Cc: Ken Cox <jkc@xxxxxxxxxx>
Cc: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
---
 drivers/staging/unisys/uislib/uisthread.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uisthread.c b/drivers/staging/unisys/uislib/uisthread.c
index 25adf1a..c5c68cb 100644
--- a/drivers/staging/unisys/uislib/uisthread.c
+++ b/drivers/staging/unisys/uislib/uisthread.c
@@ -44,13 +44,12 @@ uisthread_start(struct uisthread_info *thrinfo,
 	thrinfo->should_stop = 0;
 	/* used to stop the thread */
 	init_completion(&thrinfo->has_stopped);
-	thrinfo->task = kthread_create(threadfn, thrcontext, name, NULL);
+	thrinfo->task = kthread_run(threadfn, thrcontext, name);
 	if (IS_ERR(thrinfo->task)) {
 		thrinfo->id = 0;
 		return 0;	/* failure */
 	}
 	thrinfo->id = thrinfo->task->pid;
-	wake_up_process(thrinfo->task);
 	LOGINF("started thread pid:%d\n", thrinfo->id);
 	return 1;
 }
-- 
2.1.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux