staging: rtl8188eu: remove unnecessary variable
authorMichael Straube <straube.linux@gmail.com>
Sun, 5 Apr 2020 11:22:30 +0000 (13:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Apr 2020 06:55:32 +0000 (08:55 +0200)
The variable 'bStopBlinking' is used in if tests immediately after its
value is set. Use the conditions for setting 'bStopBlinking' diretly in
the subsequent if tests and remove the variable. Slightly reduces
object file size by 16 bytes (gcc 9.2.1 x86_64).

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200405112230.31975-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_led.c

index 91b0029d117933b177fc5657185b6c79c287bc6b..32dccae186ca26d47a7326e68f14a88fd728acd6 100644 (file)
@@ -90,7 +90,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) {
@@ -128,9 +127,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;
@@ -164,9 +161,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;
@@ -207,12 +202,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
                          msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA));
                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)