lkml.org 
[lkml]   [2021]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86: Make use of the helper macro kthread_run()
Date
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
\
 
 \ /
  Last update: 2021-10-21 10:45    [W:0.034 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site