From nobody Fri Dec 19 20:11:26 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DFE5C433F5 for ; Sat, 8 Jan 2022 12:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234413AbiAHMuu (ORCPT ); Sat, 8 Jan 2022 07:50:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbiAHMu1 (ORCPT ); Sat, 8 Jan 2022 07:50:27 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1834FC061574 for ; Sat, 8 Jan 2022 04:50:27 -0800 (PST) Received: from dslb-188-097-214-229.188.097.pools.vodafone-ip.de ([188.97.214.229] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1n6BAs-0005EJ-F3; Sat, 08 Jan 2022 13:50:22 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 12/12] staging: r8188eu: we always enqueue in rtw_set_chplan_cmd Date: Sat, 8 Jan 2022 13:49:59 +0100 Message-Id: <20220108124959.313215-13-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220108124959.313215-1-martin@kaiser.cx> References: <20220108124959.313215-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The only caller of rtw_set_chplan_cmd requests that the message be enqueued and not sent directly. Remove the enqueue parameter and the code for direct sending. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_cmd.c | 26 +++++++------------- drivers/staging/r8188eu/include/rtw_cmd.h | 2 +- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 2 +- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188= eu/core/rtw_cmd.c index 712fd6e536c4..3d22a8888ea7 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -836,7 +836,7 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter) return res; } =20 -u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue) +u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan) { struct cmd_obj *pcmdobj; struct SetChannelPlan_param *setChannelPlan_param; @@ -859,25 +859,17 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 ch= plan, u8 enqueue) } setChannelPlan_param->channel_plan =3D chplan; =20 - if (enqueue) { - /* need enqueue, prepare cmd_obj and enqueue */ - pcmdobj =3D kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (!pcmdobj) { - kfree(setChannelPlan_param); - res =3D _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_= SetChannelPlan)); - res =3D rtw_enqueue_cmd(pcmdpriv, pcmdobj); - } else { - /* no need to enqueue, do the cmd hdl directly and free cmd parameter */ - if (H2C_SUCCESS !=3D set_chplan_hdl(padapter, (unsigned char *)setChanne= lPlan_param)) - res =3D _FAIL; - + /* need enqueue, prepare cmd_obj and enqueue */ + pcmdobj =3D kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); + if (!pcmdobj) { kfree(setChannelPlan_param); + res =3D _FAIL; + goto exit; } =20 + init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_S= etChannelPlan)); + res =3D rtw_enqueue_cmd(pcmdpriv, pcmdobj); + /* do something based on res... */ if (res =3D=3D _SUCCESS) padapter->mlmepriv.ChannelPlan =3D chplan; diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8= 188eu/include/rtw_cmd.h index cf0945ae11c1..60cecdd4ee0e 100644 --- a/drivers/staging/r8188eu/include/rtw_cmd.h +++ b/drivers/staging/r8188eu/include/rtw_cmd.h @@ -772,7 +772,7 @@ u8 rtw_ps_cmd(struct adapter*padapter); =20 u8 rtw_chk_hi_queue_cmd(struct adapter*padapter); =20 -u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue); +u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan); =20 u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt); =20 diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging= /r8188eu/os_dep/ioctl_linux.c index 41b457838a5b..b9f9698d70cf 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -2098,7 +2098,7 @@ static int rtw_wx_set_channel_plan(struct net_device = *dev, struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; u8 channel_plan_req =3D (u8)(*((int *)wrqu)); =20 - if (_SUCCESS =3D=3D rtw_set_chplan_cmd(padapter, channel_plan_req, 1)) + if (_SUCCESS =3D=3D rtw_set_chplan_cmd(padapter, channel_plan_req)) DBG_88E("%s set channel_plan =3D 0x%02X\n", __func__, pmlmepriv->Channel= Plan); else return -EPERM; --=20 2.30.2