From nobody Thu Apr 2 13:15:31 2026 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 36EC9C04A95 for ; Sun, 25 Sep 2022 14:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231564AbiIYOEb (ORCPT ); Sun, 25 Sep 2022 10:04:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbiIYOE3 (ORCPT ); Sun, 25 Sep 2022 10:04:29 -0400 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 5BEB425585 for ; Sun, 25 Sep 2022 07:04:27 -0700 (PDT) Received: from dslb-188-096-144-033.188.096.pools.vodafone-ip.de ([188.96.144.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 1ocSF5-0002Rl-AY; Sun, 25 Sep 2022 16:04:23 +0200 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/2] staging: r8188eu: don't check bSurpriseRemoved in SwLedOff Date: Sun, 25 Sep 2022 16:04:05 +0200 Message-Id: <20220925140406.112991-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220925140406.112991-1-martin@kaiser.cx> References: <20220925140406.112991-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 SwLedOff function calls rtw_read8 which in turn calls usb_read. bSurpriseRemoved is checked in usb_read. We don't have to check it again in SwLedOff. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/core/rtw_led.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188= eu/core/rtw_led.c index 989808a2b171..d3bd9a97efdc 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -51,7 +51,7 @@ static void SwLedOff(struct adapter *padapter, struct led= _priv *pLed) u8 LedCfg; int res; =20 - if (padapter->bSurpriseRemoved || padapter->bDriverStopped) + if (padapter->bDriverStopped) goto exit; =20 res =3D rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */ --=20 2.30.2 From nobody Thu Apr 2 13:15:31 2026 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 93933C04A95 for ; Sun, 25 Sep 2022 14:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231995AbiIYOEj (ORCPT ); Sun, 25 Sep 2022 10:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbiIYOEg (ORCPT ); Sun, 25 Sep 2022 10:04:36 -0400 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 11CA238E for ; Sun, 25 Sep 2022 07:04:30 -0700 (PDT) Received: from dslb-188-096-144-033.188.096.pools.vodafone-ip.de ([188.96.144.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 1ocSF6-0002Rl-TS; Sun, 25 Sep 2022 16:04:24 +0200 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/2] staging: r8188eu: don't check for stop/removal in the blink worker Date: Sun, 25 Sep 2022 16:04:06 +0200 Message-Id: <20220925140406.112991-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220925140406.112991-1-martin@kaiser.cx> References: <20220925140406.112991-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 blink_work function calls either SwLedOff or SwLedOn. These two functions handle bSurpriseRemoved and bDriverStopped. There's no need to check bSurpriseRemoved and bDriverStopped again in the blink worker. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/core/rtw_led.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188= eu/core/rtw_led.c index d3bd9a97efdc..1e316e6358ea 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -77,9 +77,6 @@ static void blink_work(struct work_struct *work) struct adapter *padapter =3D pLed->padapter; struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; =20 - if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped)) - return; - if (padapter->pwrctrlpriv.rf_pwrstate !=3D rf_on) { SwLedOff(padapter, pLed); ResetLedStatus(pLed); --=20 2.30.2