Received: from viti.kaiser.cx (viti.kaiser.cx [85.214.81.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96C464C76 for ; Mon, 5 Sep 2022 20:02:07 +0000 (UTC) Received: from dslb-178-004-201-030.178.004.pools.vodafone-ip.de ([178.4.201.30] 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 1oVIIG-00063M-5V; Mon, 05 Sep 2022 22:02:04 +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 4/7] staging: r8188eu: always update status before WPS blinking Date: Mon, 5 Sep 2022 22:01:43 +0200 Message-Id: <20220905200146.82259-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220905200146.82259-1-martin@kaiser.cx> References: <20220905200146.82259-1-martin@kaiser.cx> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Always update the status variables in rtw_led_control when we start WPS blinking. The code is easier to understand without the if conditions. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 72fef3ac8c0e..4841bb2898ba 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -313,18 +313,11 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) return; cancel_delayed_work(&pLed->blink_work); - if (pLed->bLedNoLinkBlinkInProgress) - pLed->bLedNoLinkBlinkInProgress = false; - - if (pLed->bLedLinkBlinkInProgress) - pLed->bLedLinkBlinkInProgress = false; - - if (pLed->bLedBlinkInProgress) - pLed->bLedBlinkInProgress = false; - - if (pLed->bLedScanBlinkInProgress) - pLed->bLedScanBlinkInProgress = false; + pLed->bLedNoLinkBlinkInProgress = false; + pLed->bLedLinkBlinkInProgress = false; + pLed->bLedBlinkInProgress = false; + pLed->bLedScanBlinkInProgress = false; pLed->bLedWPSBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_WPS; if (pLed->bLedOn) -- 2.30.2