Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp406289pxb; Thu, 21 Oct 2021 01:46:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9VolsFKI6O3ZlaLpAvswGN3IEuack8smvbHVVS+RNtYyHpW8Mqh13AlTR0ibz3SiVWuhZ X-Received: by 2002:aa7:dbd2:: with SMTP id v18mr5896932edt.315.1634806005102; Thu, 21 Oct 2021 01:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634806005; cv=none; d=google.com; s=arc-20160816; b=pyosg6u5fb7BN3OR9wZetMAgZjFVGkAJONquCljKa8AwobZ1NJrWJBV2NkyQcTP0/u FYwgnccQD+P7Rov2I3vY5WWFgq7oQst346fvxN1Z0eredbs+9hZ4a1XH5xmn9fK9Ch6B CMqPAsVqlVHLjcuvYgPgM7IPlDJdkSiiybQp1c1+rUI+jkvIBDkTXxFYFxMlu5Drzf7x FApmjHbZofDZIYgukRatecJ6zDI3eg8dfHF5+ggQb/QvrYfKIafxM48vl4d1Rj/UdVHe 8tXFm2vasClCWLZrGL5gzxmg2FnFE+rwcEW76o6gQRzjeoKTdrwyvpa8M246mHLiugPp jQDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=EWxwsZOGFrkZwEqZiWGHVwbkc6s0ep+7cT1s1khRJls=; b=G4dWHWlHSAVvx96/EZ3gVcf8C+19NOQQ+EcHwWbWDD6u+oOc7/amc/LKGDGTFdZQsw PseMB2Ut0L2u7NpUDOTGCitQd8swdyRX3CrXGmKyIDmpSHJF7ywvglygS2Nc6bYU/nWJ 6oeu1XlmIgX6g7hgqUXzfDXlqP1ilShQW0lHa+5qofEp0iozgWjBmY39lhF88mPhdSUY HRXgcc9Ar2D5Fp9uzhoflUUkhfQZ4m5KBDVeUPVNoMjsglSNZC6FRvPmGX4IXPuasjWu CwMOIQUTz+2bfxt7Htw8l9eQ3RI8JV5qlzMkh7CnpwamxRVbVXpxqmSoHNIwO4cadPI5 DcEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si6040108ejh.227.2021.10.21.01.46.22; Thu, 21 Oct 2021 01:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231611AbhJUIqj (ORCPT + 99 others); Thu, 21 Oct 2021 04:46:39 -0400 Received: from mx22.baidu.com ([220.181.50.185]:48282 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231556AbhJUIqd (ORCPT ); Thu, 21 Oct 2021 04:46:33 -0400 Received: from BC-Mail-Ex31.internal.baidu.com (unknown [172.31.51.25]) by Forcepoint Email with ESMTPS id DF4969DB59ED37AA494A; Thu, 21 Oct 2021 16:44:16 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex31.internal.baidu.com (172.31.51.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Thu, 21 Oct 2021 16:44:16 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 16:44:15 +0800 From: Cai Huoqing To: CC: Jiri Kosina , Thomas Gleixner , "Ingo Molnar" , Borislav Petkov , , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Subject: [PATCH] x86: Make use of the helper macro kthread_run() Date: Thu, 21 Oct 2021 16:44:13 +0800 Message-ID: <20211021084414.2713-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex11.internal.baidu.com (172.31.51.51) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing --- 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