Commit 00585495 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: rtl8188eu: refactor SwLedControlMode1()

Refactor switch cases in SwLedControlMode1() to reduce
indentation level. Also clears line over 80 characters
checkpatch warnings.
Suggested-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7aaaabd5
...@@ -245,8 +245,10 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -245,8 +245,10 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
case LED_CTL_POWER_ON: case LED_CTL_POWER_ON:
case LED_CTL_START_TO_LINK: case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK: case LED_CTL_NO_LINK:
if (!pLed->bLedNoLinkBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress)
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) break;
if (pLed->CurrLedState == LED_BLINK_SCAN ||
IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedLinkBlinkInProgress) { if (pLed->bLedLinkBlinkInProgress) {
del_timer_sync(&pLed->BlinkTimer); del_timer_sync(&pLed->BlinkTimer);
...@@ -256,7 +258,6 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -256,7 +258,6 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
del_timer_sync(&pLed->BlinkTimer); del_timer_sync(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
pLed->bLedNoLinkBlinkInProgress = true; pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY; pLed->CurrLedState = LED_BLINK_SLOWLY;
if (pLed->bLedOn) if (pLed->bLedOn)
...@@ -265,11 +266,12 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -265,11 +266,12 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA));
}
break; break;
case LED_CTL_LINK: case LED_CTL_LINK:
if (!pLed->bLedLinkBlinkInProgress) { if (pLed->bLedLinkBlinkInProgress)
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) break;
if (pLed->CurrLedState == LED_BLINK_SCAN ||
IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer_sync(&pLed->BlinkTimer); del_timer_sync(&pLed->BlinkTimer);
...@@ -287,12 +289,13 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -287,12 +289,13 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA));
}
break; break;
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED))) { if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
; check_fwstate(pmlmepriv, _FW_LINKED))
} else if (!pLed->bLedScanBlinkInProgress) { break;
if (pLed->bLedScanBlinkInProgress)
break;
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress) {
...@@ -316,12 +319,13 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -316,12 +319,13 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA));
}
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if (!pLed->bLedBlinkInProgress) { if (pLed->bLedBlinkInProgress)
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) break;
if (pLed->CurrLedState == LED_BLINK_SCAN ||
IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer_sync(&pLed->BlinkTimer); del_timer_sync(&pLed->BlinkTimer);
...@@ -340,11 +344,11 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -340,11 +344,11 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA));
}
break; break;
case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS: /* wait until xinpin finish */
case LED_CTL_START_WPS_BOTTON: case LED_CTL_START_WPS_BOTTON:
if (!pLed->bLedWPSBlinkInProgress) { if (pLed->bLedWPSBlinkInProgress)
break;
if (pLed->bLedNoLinkBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer_sync(&pLed->BlinkTimer); del_timer_sync(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
...@@ -369,7 +373,6 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct ...@@ -369,7 +373,6 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA));
}
break; break;
case LED_CTL_STOP_WPS: case LED_CTL_STOP_WPS:
if (pLed->bLedNoLinkBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment