staging: r8188eu: remove bStopBlinking
authorMartin Kaiser <martin@kaiser.cx>
Sun, 26 Dec 2021 19:55:52 +0000 (20:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Dec 2021 16:12:35 +0000 (17:12 +0100)
Remove the temporary variable bStopBlinking and check the conditions
directly in the if clauses. There's no need to save the result of
these checks.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211226195556.159471-18-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_led.c

index 20e8057..e554fef 100644 (file)
@@ -66,7 +66,6 @@ static void SwLedBlink1(struct LED_871x *pLed)
 {
        struct adapter *padapter = pLed->padapter;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       u8 bStopBlinking = false;
 
        /*  Change LED according to BlinkingLedState specified. */
        if (pLed->BlinkingLedState == RTW_LED_ON)
@@ -97,9 +96,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
                break;
        case LED_BLINK_SCAN:
                pLed->BlinkTimes--;
-               if (pLed->BlinkTimes == 0)
-                       bStopBlinking = true;
-               if (bStopBlinking) {
+               if (pLed->BlinkTimes == 0) {
                        if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->bLedLinkBlinkInProgress = true;
                                pLed->CurrLedState = LED_BLINK_NORMAL;
@@ -128,9 +125,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
                break;
        case LED_BLINK_TXRX:
                pLed->BlinkTimes--;
-               if (pLed->BlinkTimes == 0)
-                       bStopBlinking = true;
-               if (bStopBlinking) {
+               if (pLed->BlinkTimes == 0) {
                        if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->bLedLinkBlinkInProgress = true;
                                pLed->CurrLedState = LED_BLINK_NORMAL;
@@ -165,12 +160,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
                schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL);
                break;
        case LED_BLINK_WPS_STOP:        /* WPS success */
-               if (pLed->BlinkingLedState == RTW_LED_ON)
-                       bStopBlinking = false;
-               else
-                       bStopBlinking = true;
-
-               if (bStopBlinking) {
+               if (pLed->BlinkingLedState != RTW_LED_ON) {
                        pLed->bLedLinkBlinkInProgress = true;
                        pLed->CurrLedState = LED_BLINK_NORMAL;
                        if (pLed->bLedOn)