From nobody Mon Apr 6 04:45:35 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 77A4CECAAD3 for ; Sun, 11 Sep 2022 14:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbiIKOvz (ORCPT ); Sun, 11 Sep 2022 10:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbiIKOvn (ORCPT ); Sun, 11 Sep 2022 10:51:43 -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 3FD342CCA9 for ; Sun, 11 Sep 2022 07:51:40 -0700 (PDT) Received: from ipservice-092-217-076-063.092.217.pools.vodafone-ip.de ([92.217.76.63] 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 1oXOJ6-000829-0j; Sun, 11 Sep 2022 16:51:36 +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/9] staging: r8188eu: simplify the code to prevent scan blinking restart Date: Sun, 11 Sep 2022 16:51:14 +0200 Message-Id: <20220911145122.15444-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220911145122.15444-1-martin@kaiser.cx> References: <20220911145122.15444-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 code for scan blinking is wrapped into a big if clause to prevent restarting if scan blinking is already running. Revert the if condition and exit if scan blinking is running. This does not change the behaviour. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 47 +++++++++++++------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188= eu/core/rtw_led.c index 5b7e12421d19..c934a1f1e119 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -261,30 +261,31 @@ void rtw_led_control(struct adapter *padapter, enum L= ED_CTL_MODE LedAction) if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv= , _FW_LINKED))) return; =20 - if (!pLed->bLedScanBlinkInProgress) { - if (IS_LED_WPS_BLINKING(pLed)) - return; - if (pLed->bLedNoLinkBlinkInProgress) { - cancel_delayed_work(&pLed->blink_work); - pLed->bLedNoLinkBlinkInProgress =3D false; - } - if (pLed->bLedLinkBlinkInProgress) { - cancel_delayed_work(&pLed->blink_work); - pLed->bLedLinkBlinkInProgress =3D false; - } - if (pLed->bLedBlinkInProgress) { - cancel_delayed_work(&pLed->blink_work); - pLed->bLedBlinkInProgress =3D false; - } - pLed->bLedScanBlinkInProgress =3D true; - pLed->CurrLedState =3D LED_BLINK_SCAN; - pLed->BlinkTimes =3D 24; - if (pLed->bLedOn) - pLed->BlinkingLedState =3D RTW_LED_OFF; - else - pLed->BlinkingLedState =3D RTW_LED_ON; - schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL); + if (pLed->bLedScanBlinkInProgress) + return; + + if (IS_LED_WPS_BLINKING(pLed)) + return; + if (pLed->bLedNoLinkBlinkInProgress) { + cancel_delayed_work(&pLed->blink_work); + pLed->bLedNoLinkBlinkInProgress =3D false; + } + if (pLed->bLedLinkBlinkInProgress) { + cancel_delayed_work(&pLed->blink_work); + pLed->bLedLinkBlinkInProgress =3D false; } + if (pLed->bLedBlinkInProgress) { + cancel_delayed_work(&pLed->blink_work); + pLed->bLedBlinkInProgress =3D false; + } + pLed->bLedScanBlinkInProgress =3D true; + pLed->CurrLedState =3D LED_BLINK_SCAN; + pLed->BlinkTimes =3D 24; + if (pLed->bLedOn) + pLed->BlinkingLedState =3D RTW_LED_OFF; + else + pLed->BlinkingLedState =3D RTW_LED_ON; + schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL); break; case LED_CTL_TX: case LED_CTL_RX: --=20 2.30.2