These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / rtl8712 / rtl8712_led.c
index ada8d5d..9055827 100644 (file)
@@ -122,8 +122,7 @@ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed)
 {
        u8      LedCfg;
 
-       if ((padapter->bSurpriseRemoved == true) ||
-           (padapter->bDriverStopped == true))
+       if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
                return;
        LedCfg = r8712_read8(padapter, LEDCFG);
        switch (pLed->LedPin) {
@@ -131,11 +130,11 @@ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed)
                break;
        case LED_PIN_LED0:
                /* SW control led0 on.*/
-               r8712_write8(padapter, LEDCFG, LedCfg&0xf0);
+               r8712_write8(padapter, LEDCFG, LedCfg & 0xf0);
                break;
        case LED_PIN_LED1:
                /* SW control led1 on.*/
-               r8712_write8(padapter, LEDCFG, LedCfg&0x0f);
+               r8712_write8(padapter, LEDCFG, LedCfg & 0x0f);
                break;
        default:
                break;
@@ -151,8 +150,7 @@ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed)
 {
        u8      LedCfg;
 
-       if ((padapter->bSurpriseRemoved == true) ||
-           (padapter->bDriverStopped == true))
+       if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
                return;
        LedCfg = r8712_read8(padapter, LEDCFG);
        switch (pLed->LedPin) {
@@ -160,11 +158,11 @@ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed)
                break;
        case LED_PIN_LED0:
                LedCfg &= 0xf0; /* Set to software control.*/
-               r8712_write8(padapter, LEDCFG, (LedCfg|BIT(3)));
+               r8712_write8(padapter, LEDCFG, (LedCfg | BIT(3)));
                break;
        case LED_PIN_LED1:
                LedCfg &= 0x0f; /* Set to software control.*/
-               r8712_write8(padapter, LEDCFG, (LedCfg|BIT(7)));
+               r8712_write8(padapter, LEDCFG, (LedCfg | BIT(7)));
                break;
        default:
                break;
@@ -222,11 +220,11 @@ static void SwLedBlink(struct LED_871x *pLed)
                        bStopBlinking = true;
                break;
        case LED_BLINK_StartToBlink:
-               if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
+               if (check_fwstate(pmlmepriv, _FW_LINKED) &&
                    (pmlmepriv->fw_state & WIFI_STATION_STATE))
                        bStopBlinking = true;
-               if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
-                  ((pmlmepriv->fw_state & WIFI_ADHOC_STATE) ||
+               if (check_fwstate(pmlmepriv, _FW_LINKED) &&
+                   ((pmlmepriv->fw_state & WIFI_ADHOC_STATE) ||
                    (pmlmepriv->fw_state & WIFI_ADHOC_MASTER_STATE)))
                        bStopBlinking = true;
                else if (pLed->BlinkTimes == 0)
@@ -241,11 +239,10 @@ static void SwLedBlink(struct LED_871x *pLed)
                break;
        }
        if (bStopBlinking) {
-               if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
-                   (pLed->bLedOn == false))
+               if (check_fwstate(pmlmepriv, _FW_LINKED) &&
+                   !pLed->bLedOn)
                        SwLedOn(padapter, pLed);
-               else if ((check_fwstate(pmlmepriv, _FW_LINKED) ==
-                        true) &&  pLed->bLedOn == true)
+               else if (check_fwstate(pmlmepriv, _FW_LINKED) &&  pLed->bLedOn)
                        SwLedOff(padapter, pLed);
                pLed->BlinkTimes = 0;
                pLed->bLedBlinkInProgress = false;
@@ -296,18 +293,20 @@ static void SwLedBlink1(struct LED_871x *pLed)
        else
                SwLedOff(padapter, pLed);
        if (peeprompriv->CustomerID == RT_CID_DEFAULT) {
-               if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+               if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                        if (!pLed1->bSWLedCtrl) {
                                SwLedOn(padapter, pLed1);
                                pLed1->bSWLedCtrl = true;
-                       } else if (!pLed1->bLedOn)
+                       } else if (!pLed1->bLedOn) {
                                SwLedOn(padapter, pLed1);
+                       }
                } else {
                        if (!pLed1->bSWLedCtrl) {
                                SwLedOff(padapter, pLed1);
                                pLed1->bSWLedCtrl = true;
-                       } else if (pLed1->bLedOn)
+                       } else if (pLed1->bLedOn) {
                                SwLedOff(padapter, pLed1);
+                       }
                }
        }
        switch (pLed->CurrLedState) {
@@ -332,7 +331,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->bLedLinkBlinkInProgress = true;
                                pLed->CurrLedState = LED_BLINK_NORMAL;
                                if (pLed->bLedOn)
@@ -366,7 +365,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->bLedLinkBlinkInProgress = true;
                                pLed->CurrLedState = LED_BLINK_NORMAL;
                                if (pLed->bLedOn)
@@ -410,8 +409,9 @@ static void SwLedBlink1(struct LED_871x *pLed)
                        mod_timer(&pLed->BlinkTimer, jiffies +
                                  msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
                        bStopBlinking = false;
-               } else
+               } else {
                        bStopBlinking = true;
+               }
                if (bStopBlinking) {
                        pLed->bLedLinkBlinkInProgress = true;
                        pLed->CurrLedState = LED_BLINK_NORMAL;
@@ -446,7 +446,7 @@ static void SwLedBlink2(struct LED_871x *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->CurrLedState = LED_ON;
                                pLed->BlinkingLedState = LED_ON;
                                SwLedOn(padapter, pLed);
@@ -470,7 +470,7 @@ static void SwLedBlink2(struct LED_871x *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->CurrLedState = LED_ON;
                                pLed->BlinkingLedState = LED_ON;
                                SwLedOn(padapter, pLed);
@@ -512,7 +512,7 @@ static void SwLedBlink3(struct LED_871x *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->CurrLedState = LED_ON;
                                pLed->BlinkingLedState = LED_ON;
                                if (!pLed->bLedOn)
@@ -538,7 +538,7 @@ static void SwLedBlink3(struct LED_871x *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->CurrLedState = LED_ON;
                                pLed->BlinkingLedState = LED_ON;
                                if (!pLed->bLedOn)
@@ -573,8 +573,9 @@ static void SwLedBlink3(struct LED_871x *pLed)
                        mod_timer(&pLed->BlinkTimer, jiffies +
                                  msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
                        bStopBlinking = false;
-               } else
+               } else {
                        bStopBlinking = true;
+               }
                if (bStopBlinking) {
                        pLed->CurrLedState = LED_ON;
                        pLed->BlinkingLedState = LED_ON;
@@ -827,8 +828,7 @@ static void BlinkTimerCallback(unsigned long data)
 
        /* This fixed the crash problem on Fedora 12 when trying to do the
         * insmod;ifconfig up;rmmod commands. */
-       if ((pLed->padapter->bSurpriseRemoved == true) ||
-           (pLed->padapter->bDriverStopped == true))
+       if (pLed->padapter->bSurpriseRemoved || pLed->padapter->bDriverStopped)
                return;
        schedule_work(&pLed->BlinkWorkItem);
 }
@@ -893,15 +893,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
        switch (LedAction) {
        case LED_CTL_START_TO_LINK:
        case LED_CTL_NO_LINK:
-               if (pLed->bLedNoLinkBlinkInProgress == false) {
+               if (!pLed->bLedNoLinkBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                          IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedLinkBlinkInProgress == true) {
+                       if (pLed->bLedLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -916,15 +916,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
                }
                break;
        case LED_CTL_LINK:
-               if (pLed->bLedLinkBlinkInProgress == false) {
+               if (!pLed->bLedLinkBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                            IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -939,21 +939,21 @@ static void SwLedControlMode1(struct _adapter *padapter,
                }
                break;
        case LED_CTL_SITE_SURVEY:
-               if ((psitesurveyctrl->traffic_busy) &&
-                   (check_fwstate(pmlmepriv, _FW_LINKED) == true))
+               if (psitesurveyctrl->traffic_busy &&
+                   check_fwstate(pmlmepriv, _FW_LINKED))
                        ; /* dummy branch */
-                else if (pLed->bLedScanBlinkInProgress == false) {
+                else if (!pLed->bLedScanBlinkInProgress) {
                        if (IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedLinkBlinkInProgress == true) {
+                       if (pLed->bLedLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                 pLed->bLedLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -970,15 +970,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
                break;
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if (pLed->bLedBlinkInProgress == false) {
+               if (!pLed->bLedBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                            IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedLinkBlinkInProgress == true) {
+                       if (pLed->bLedLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedLinkBlinkInProgress = false;
                        }
@@ -996,20 +996,20 @@ static void SwLedControlMode1(struct _adapter *padapter,
 
        case LED_CTL_START_WPS: /*wait until xinpin finish */
        case LED_CTL_START_WPS_BOTTON:
-                if (pLed->bLedWPSBlinkInProgress == false) {
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                if (!pLed->bLedWPSBlinkInProgress) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedLinkBlinkInProgress == true) {
+                       if (pLed->bLedLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                 pLed->bLedLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
-                       if (pLed->bLedScanBlinkInProgress == true) {
+                       if (pLed->bLedScanBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedScanBlinkInProgress = false;
                        }
@@ -1024,19 +1024,19 @@ static void SwLedControlMode1(struct _adapter *padapter,
                }
                break;
        case LED_CTL_STOP_WPS:
-               if (pLed->bLedNoLinkBlinkInProgress == true) {
+               if (pLed->bLedNoLinkBlinkInProgress) {
                        del_timer(&pLed->BlinkTimer);
                        pLed->bLedNoLinkBlinkInProgress = false;
                }
-               if (pLed->bLedLinkBlinkInProgress == true) {
+               if (pLed->bLedLinkBlinkInProgress) {
                        del_timer(&pLed->BlinkTimer);
                         pLed->bLedLinkBlinkInProgress = false;
                }
-               if (pLed->bLedBlinkInProgress == true) {
+               if (pLed->bLedBlinkInProgress) {
                        del_timer(&pLed->BlinkTimer);
                        pLed->bLedBlinkInProgress = false;
                }
-               if (pLed->bLedScanBlinkInProgress == true) {
+               if (pLed->bLedScanBlinkInProgress) {
                        del_timer(&pLed->BlinkTimer);
                        pLed->bLedScanBlinkInProgress = false;
                }
@@ -1111,11 +1111,11 @@ static void SwLedControlMode2(struct _adapter *padapter,
        case LED_CTL_SITE_SURVEY:
                 if (pmlmepriv->sitesurveyctrl.traffic_busy)
                        ; /* dummy branch */
-                else if (pLed->bLedScanBlinkInProgress == false) {
+                else if (!pLed->bLedScanBlinkInProgress) {
                        if (IS_LED_WPS_BLINKING(pLed))
                                return;
 
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -1133,8 +1133,8 @@ static void SwLedControlMode2(struct _adapter *padapter,
 
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if ((pLed->bLedBlinkInProgress == false) &&
-                  (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+               if (!pLed->bLedBlinkInProgress &&
+                   check_fwstate(pmlmepriv, _FW_LINKED)) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                           IS_LED_WPS_BLINKING(pLed))
                                return;
@@ -1168,12 +1168,12 @@ static void SwLedControlMode2(struct _adapter *padapter,
 
        case LED_CTL_START_WPS: /*wait until xinpin finish*/
        case LED_CTL_START_WPS_BOTTON:
-               if (pLed->bLedWPSBlinkInProgress == false) {
-                       if (pLed->bLedBlinkInProgress == true) {
+               if (!pLed->bLedWPSBlinkInProgress) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
-                       if (pLed->bLedScanBlinkInProgress == true) {
+                       if (pLed->bLedScanBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedScanBlinkInProgress = false;
                        }
@@ -1244,10 +1244,10 @@ static void SwLedControlMode3(struct _adapter *padapter,
        case LED_CTL_SITE_SURVEY:
                if (pmlmepriv->sitesurveyctrl.traffic_busy)
                        ; /* dummy branch */
-               else if (pLed->bLedScanBlinkInProgress == false) {
+               else if (!pLed->bLedScanBlinkInProgress) {
                        if (IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -1264,8 +1264,8 @@ static void SwLedControlMode3(struct _adapter *padapter,
                break;
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if ((pLed->bLedBlinkInProgress == false) &&
-                   (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+               if (!pLed->bLedBlinkInProgress &&
+                   check_fwstate(pmlmepriv, _FW_LINKED)) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                            IS_LED_WPS_BLINKING(pLed))
                                return;
@@ -1298,12 +1298,12 @@ static void SwLedControlMode3(struct _adapter *padapter,
                break;
        case LED_CTL_START_WPS: /* wait until xinpin finish */
        case LED_CTL_START_WPS_BOTTON:
-               if (pLed->bLedWPSBlinkInProgress == false) {
-                       if (pLed->bLedBlinkInProgress == true) {
+               if (!pLed->bLedWPSBlinkInProgress) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
-                       if (pLed->bLedScanBlinkInProgress == true) {
+                       if (pLed->bLedScanBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedScanBlinkInProgress = false;
                        }
@@ -1321,8 +1321,9 @@ static void SwLedControlMode3(struct _adapter *padapter,
                if (pLed->bLedWPSBlinkInProgress) {
                        del_timer(&pLed->BlinkTimer);
                        pLed->bLedWPSBlinkInProgress = false;
-               } else
+               } else {
                        pLed->bLedWPSBlinkInProgress = true;
+               }
                pLed->CurrLedState = LED_BLINK_WPS_STOP;
                if (pLed->bLedOn) {
                        pLed->BlinkingLedState = LED_OFF;
@@ -1395,15 +1396,15 @@ static void SwLedControlMode4(struct _adapter *padapter,
                                mod_timer(&pLed->BlinkTimer,
                                          jiffies + msecs_to_jiffies(0));
                }
-               if (pLed->bLedStartToLinkBlinkInProgress == false) {
+               if (!pLed->bLedStartToLinkBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                            IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
@@ -1434,11 +1435,11 @@ static void SwLedControlMode4(struct _adapter *padapter,
                                                  jiffies + msecs_to_jiffies(0));
                        }
                }
-               if (pLed->bLedNoLinkBlinkInProgress == false) {
+               if (!pLed->bLedNoLinkBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                            IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -1453,17 +1454,17 @@ static void SwLedControlMode4(struct _adapter *padapter,
                }
                break;
        case LED_CTL_SITE_SURVEY:
-               if ((pmlmepriv->sitesurveyctrl.traffic_busy) &&
-                   (check_fwstate(pmlmepriv, _FW_LINKED) == true))
+               if (pmlmepriv->sitesurveyctrl.traffic_busy &&
+                   check_fwstate(pmlmepriv, _FW_LINKED))
                        ;
-               else if (pLed->bLedScanBlinkInProgress == false) {
+               else if (!pLed->bLedScanBlinkInProgress) {
                        if (IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -1480,11 +1481,11 @@ static void SwLedControlMode4(struct _adapter *padapter,
                break;
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if (pLed->bLedBlinkInProgress == false) {
+               if (!pLed->bLedBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK ||
                            IS_LED_WPS_BLINKING(pLed))
                                return;
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
@@ -1510,16 +1511,16 @@ static void SwLedControlMode4(struct _adapter *padapter,
                                mod_timer(&pLed->BlinkTimer,
                                          jiffies + msecs_to_jiffies(0));
                }
-               if (pLed->bLedWPSBlinkInProgress == false) {
-                       if (pLed->bLedNoLinkBlinkInProgress == true) {
+               if (!pLed->bLedWPSBlinkInProgress) {
+                       if (pLed->bLedNoLinkBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedNoLinkBlinkInProgress = false;
                        }
-                       if (pLed->bLedBlinkInProgress == true) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
-                       if (pLed->bLedScanBlinkInProgress == true) {
+                       if (pLed->bLedScanBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedScanBlinkInProgress = false;
                        }
@@ -1666,11 +1667,11 @@ static void SwLedControlMode5(struct _adapter *padapter,
                          jiffies + msecs_to_jiffies(0));
                break;
        case LED_CTL_SITE_SURVEY:
-               if ((pmlmepriv->sitesurveyctrl.traffic_busy) &&
-                   (check_fwstate(pmlmepriv, _FW_LINKED) == true))
+               if (pmlmepriv->sitesurveyctrl.traffic_busy &&
+                   check_fwstate(pmlmepriv, _FW_LINKED))
                        ; /* dummy branch */
-               else if (pLed->bLedScanBlinkInProgress == false) {
-                       if (pLed->bLedBlinkInProgress == true) {
+               else if (!pLed->bLedScanBlinkInProgress) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -1687,7 +1688,7 @@ static void SwLedControlMode5(struct _adapter *padapter,
                break;
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if (pLed->bLedBlinkInProgress == false) {
+               if (!pLed->bLedBlinkInProgress) {
                        if (pLed->CurrLedState == LED_SCAN_BLINK)
                                return;
                        pLed->bLedBlinkInProgress = true;
@@ -1737,8 +1738,8 @@ static void SwLedControlMode6(struct _adapter *padapter,
                break;
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if (pLed->bLedBlinkInProgress == false &&
-                  (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+               if (!pLed->bLedBlinkInProgress &&
+                   check_fwstate(pmlmepriv, _FW_LINKED)) {
                        if (IS_LED_WPS_BLINKING(pLed))
                                return;
                        pLed->bLedBlinkInProgress = true;
@@ -1754,8 +1755,8 @@ static void SwLedControlMode6(struct _adapter *padapter,
                break;
        case LED_CTL_START_WPS: /*wait until xinpin finish*/
        case LED_CTL_START_WPS_BOTTON:
-               if (pLed->bLedWPSBlinkInProgress == false) {
-                       if (pLed->bLedBlinkInProgress == true) {
+               if (!pLed->bLedWPSBlinkInProgress) {
+                       if (pLed->bLedBlinkInProgress) {
                                del_timer(&pLed->BlinkTimer);
                                pLed->bLedBlinkInProgress = false;
                        }
@@ -1805,7 +1806,7 @@ void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction)
 {
        struct led_priv *ledpriv = &(padapter->ledpriv);
 
-       if (ledpriv->bRegUseLed == false)
+       if (!ledpriv->bRegUseLed)
                return;
        switch (ledpriv->LedStrategy) {
        case SW_LED_MODE0: