All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Make use of the helper macro kthread_run()
@ 2021-10-21  8:44 Cai Huoqing
  0 siblings, 0 replies; only message in thread
From: Cai Huoqing @ 2021-10-21  8:44 UTC (permalink / raw)
  To: caihuoqing
  Cc: Jiri Kosina, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, Dave Hansen, Andy Lutomirski, Peter Zijlstra,
	linux-kernel

Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 arch/x86/kernel/apm_32.c   | 3 +--
 arch/x86/mm/pat/cpa-test.c | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 241dda687eb9..0bc62af68ac5 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -2347,7 +2347,7 @@ static int __init apm_init(void)
 
 	proc_create_single("apm", 0, NULL, proc_apm_show);
 
-	kapmd_task = kthread_create(apm, NULL, "kapmd");
+	kapmd_task = kthread_run(apm, NULL, "kapmd");
 	if (IS_ERR(kapmd_task)) {
 		pr_err("disabled - Unable to start kernel thread\n");
 		err = PTR_ERR(kapmd_task);
@@ -2355,7 +2355,6 @@ static int __init apm_init(void)
 		remove_proc_entry("apm", NULL);
 		return err;
 	}
-	wake_up_process(kapmd_task);
 
 	if (num_online_cpus() > 1 && !smp) {
 		printk(KERN_NOTICE
diff --git a/arch/x86/mm/pat/cpa-test.c b/arch/x86/mm/pat/cpa-test.c
index 0612a73638a8..8022a5769a45 100644
--- a/arch/x86/mm/pat/cpa-test.c
+++ b/arch/x86/mm/pat/cpa-test.c
@@ -266,10 +266,8 @@ static int start_pageattr_test(void)
 {
 	struct task_struct *p;
 
-	p = kthread_create(do_pageattr_test, NULL, "pageattr-test");
-	if (!IS_ERR(p))
-		wake_up_process(p);
-	else
+	p = kthread_run(do_pageattr_test, NULL, "pageattr-test");
+	if (IS_ERR(p))
 		WARN_ON(1);
 
 	return 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-21  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  8:44 [PATCH] x86: Make use of the helper macro kthread_run() Cai Huoqing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.