From nobody Sun Sep 22 13:15:47 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E544BC433FE for ; Thu, 21 Oct 2021 08:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCE30610EA for ; Thu, 21 Oct 2021 08:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231461AbhJUIoM (ORCPT ); Thu, 21 Oct 2021 04:44:12 -0400 Received: from mx24.baidu.com ([111.206.215.185]:45398 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231406AbhJUIoK (ORCPT ); Thu, 21 Oct 2021 04:44:10 -0400 Received: from BC-Mail-Ex10.internal.baidu.com (unknown [172.31.51.50]) by Forcepoint Email with ESMTPS id 3E3446DF737E714A94FD; Thu, 21 Oct 2021 16:41:53 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex10.internal.baidu.com (172.31.51.50) 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:41:52 +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:41:52 +0800 From: Cai Huoqing To: CC: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , "Kalle Valo" , "David S. Miller" , "Jakub Kicinski" , Matthias Brugger , , , , , Subject: [PATCH] mt76: Make use of the helper macro kthread_run() Date: Thu, 21 Oct 2021 16:41:49 +0800 Message-ID: <20211021084150.2130-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX02.internal.baidu.com (172.31.51.42) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing --- drivers/net/wireless/mediatek/mt76/util.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/util.h b/drivers/net/wirele= ss/mediatek/mt76/util.h index 1c363ea9ab9c..49c52d781f40 100644 --- a/drivers/net/wireless/mediatek/mt76/util.h +++ b/drivers/net/wireless/mediatek/mt76/util.h @@ -70,17 +70,15 @@ mt76_worker_setup(struct ieee80211_hw *hw, struct mt76_= worker *w, =20 if (fn) w->fn =3D fn; - w->task =3D kthread_create(__mt76_worker_fn, w, "mt76-%s %s", - name, dev_name); + w->task =3D kthread_run(__mt76_worker_fn, w, + "mt76-%s %s", name, dev_name); =20 - ret =3D PTR_ERR_OR_ZERO(w->task); - if (ret) { + if (IS_ERR(w->task)) { + ret =3D PTR_ERR(w->task); w->task =3D NULL; return ret; } =20 - wake_up_process(w->task); - return 0; } =20 --=20 2.25.1