From nobody Fri Sep 12 22:26:41 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 6835BC636D4 for ; Mon, 6 Feb 2023 21:01:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbjBFVBt (ORCPT ); Mon, 6 Feb 2023 16:01:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbjBFVBm (ORCPT ); Mon, 6 Feb 2023 16:01:42 -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 29FF324CB8 for ; Mon, 6 Feb 2023 13:01:41 -0800 (PST) Received: from ipservice-092-217-084-033.092.217.pools.vodafone-ip.de ([92.217.84.33] 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 1pP8cI-000876-HV; Mon, 06 Feb 2023 22:01:34 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/3] staging: r8188eu: make ips_enter static Date: Mon, 6 Feb 2023 22:01:22 +0100 Message-Id: <20230206210124.150142-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230206210124.150142-1-martin@kaiser.cx> References: <20230206210124.150142-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 ips_enter function is used only in rtw_pwrctrl.c. We can make this function static. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +- drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r= 8188eu/core/rtw_pwrctrl.c index 5290ac36f08c..e70d78357bcb 100644 --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c @@ -8,7 +8,7 @@ #include "../include/osdep_intf.h" #include "../include/linux/usb.h" =20 -void ips_enter(struct adapter *padapter) +static void ips_enter(struct adapter *padapter) { struct pwrctrl_priv *pwrpriv =3D &padapter->pwrctrlpriv; struct xmit_priv *pxmit_priv =3D &padapter->xmitpriv; diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/stagin= g/r8188eu/include/rtw_pwrctrl.h index 6e9fdd66fad1..56492ab0f78d 100644 --- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h @@ -99,7 +99,6 @@ void rtw_set_firmware_ps_mode(struct adapter *adapter, u8= mode); void rtw_set_ps_mode(struct adapter *adapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode); void LeaveAllPowerSaveMode(struct adapter *adapter); -void ips_enter(struct adapter *padapter); int ips_leave(struct adapter *padapter); =20 void rtw_ps_processor(struct adapter *padapter); --=20 2.30.2 From nobody Fri Sep 12 22:26:41 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 13973C05027 for ; Mon, 6 Feb 2023 21:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbjBFVBy (ORCPT ); Mon, 6 Feb 2023 16:01:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbjBFVBs (ORCPT ); Mon, 6 Feb 2023 16:01:48 -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 0BAE92B2B5 for ; Mon, 6 Feb 2023 13:01:46 -0800 (PST) Received: from ipservice-092-217-084-033.092.217.pools.vodafone-ip.de ([92.217.84.33] 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 1pP8cJ-000876-HA; Mon, 06 Feb 2023 22:01:35 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/3] staging: r8188eu: make ips_leave static Date: Mon, 6 Feb 2023 22:01:23 +0100 Message-Id: <20230206210124.150142-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230206210124.150142-1-martin@kaiser.cx> References: <20230206210124.150142-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 ips_leave function is used only in rtw_pwrctrl.c. We can make this function static. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +- drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r= 8188eu/core/rtw_pwrctrl.c index e70d78357bcb..702a29f96d74 100644 --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c @@ -39,7 +39,7 @@ static void ips_enter(struct adapter *padapter) mutex_unlock(&pwrpriv->lock); } =20 -int ips_leave(struct adapter *padapter) +static int ips_leave(struct adapter *padapter) { struct pwrctrl_priv *pwrpriv =3D &padapter->pwrctrlpriv; struct security_priv *psecuritypriv =3D &padapter->securitypriv; diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/stagin= g/r8188eu/include/rtw_pwrctrl.h index 56492ab0f78d..f7aeac262fad 100644 --- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h @@ -99,7 +99,6 @@ void rtw_set_firmware_ps_mode(struct adapter *adapter, u8= mode); void rtw_set_ps_mode(struct adapter *adapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode); void LeaveAllPowerSaveMode(struct adapter *adapter); -int ips_leave(struct adapter *padapter); =20 void rtw_ps_processor(struct adapter *padapter); =20 --=20 2.30.2 From nobody Fri Sep 12 22:26:41 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 4440CC636D3 for ; Mon, 6 Feb 2023 21:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbjBFVBv (ORCPT ); Mon, 6 Feb 2023 16:01:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjBFVBn (ORCPT ); Mon, 6 Feb 2023 16:01:43 -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 DD05629162 for ; Mon, 6 Feb 2023 13:01:42 -0800 (PST) Received: from ipservice-092-217-084-033.092.217.pools.vodafone-ip.de ([92.217.84.33] 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 1pP8cK-000876-Rq; Mon, 06 Feb 2023 22:01:36 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/3] staging: r8188eu: remove change_rfpwrstate Date: Mon, 6 Feb 2023 22:01:24 +0100 Message-Id: <20230206210124.150142-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230206210124.150142-1-martin@kaiser.cx> References: <20230206210124.150142-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" Remove the change_rfpwrstate component in struct pwrctrl_priv. change_rfpwrstate is set to rf_off directly before each ips_enter call and then checked in ips_enter. This makes no sense. change_rfpwrstate might have been used to avoid conflicts between suspend and resume operations. If a driver has to do this at all, pwrpriv->ps_processing will do this job. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 19 ++++++++----------- drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 - 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r= 8188eu/core/rtw_pwrctrl.c index 702a29f96d74..051cdcb11ff5 100644 --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c @@ -25,15 +25,14 @@ static void ips_enter(struct adapter *padapter) pwrpriv->ips_mode =3D pwrpriv->ips_mode_req; =20 pwrpriv->ips_enter_cnts++; - if (rf_off =3D=3D pwrpriv->change_rfpwrstate) { - pwrpriv->bpower_saving =3D true; + pwrpriv->bpower_saving =3D true; =20 - if (pwrpriv->ips_mode =3D=3D IPS_LEVEL_2) - pwrpriv->bkeepfwalive =3D true; + if (pwrpriv->ips_mode =3D=3D IPS_LEVEL_2) + pwrpriv->bkeepfwalive =3D true; + + rtw_ips_pwr_down(padapter); + pwrpriv->rf_pwrstate =3D rf_off; =20 - rtw_ips_pwr_down(padapter); - pwrpriv->rf_pwrstate =3D rf_off; - } pwrpriv->bips_processing =3D false; =20 mutex_unlock(&pwrpriv->lock); @@ -51,7 +50,6 @@ static int ips_leave(struct adapter *padapter) =20 if ((pwrpriv->rf_pwrstate =3D=3D rf_off) && (!pwrpriv->bips_processing)) { pwrpriv->bips_processing =3D true; - pwrpriv->change_rfpwrstate =3D rf_on; pwrpriv->ips_leave_cnts++; =20 result =3D rtw_ips_pwr_up(padapter); @@ -133,10 +131,9 @@ void rtw_ps_processor(struct adapter *padapter) if (!rtw_pwr_unassociated_idle(padapter)) goto exit; =20 - if (pwrpriv->rf_pwrstate =3D=3D rf_on) { - pwrpriv->change_rfpwrstate =3D rf_off; + if (pwrpriv->rf_pwrstate =3D=3D rf_on) ips_enter(padapter); - } + exit: rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv); pwrpriv->ps_processing =3D false; diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/stagin= g/r8188eu/include/rtw_pwrctrl.h index f7aeac262fad..9f5cffd8bfb1 100644 --- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h @@ -71,7 +71,6 @@ struct pwrctrl_priv { int pwr_state_check_interval; =20 enum rt_rf_power_state rf_pwrstate;/* cur power state */ - enum rt_rf_power_state change_rfpwrstate; =20 u8 bkeepfwalive; }; --=20 2.30.2