[PATCH 3/6] staging: r8188eu: remove bLedNoLinkBlinkInProgress
From: Martin Kaiser
Date: Sun Sep 18 2022 - 13:57:27 EST
Remove the bLedNoLinkBlinkInProgress state variable. Its sole purpose is
to block subsequent requests for "no link" blinking when this blinking
pattern is already active.
It's perfectly safe to restart "no link" blinking. We can remove
bLedNoLinkBlinkInProgress and the many places where it's updated.
Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
---
drivers/staging/r8188eu/core/rtw_led.c | 14 --------------
drivers/staging/r8188eu/include/rtw_led.h | 1 -
2 files changed, 15 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index eac35f048f52..aee3ea3613a9 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -27,7 +27,6 @@ static void ResetLedStatus(struct led_priv *pLed)
pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
pLed->BlinkingLedState = LED_UNKNOWN; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
}
@@ -121,7 +120,6 @@ static void blink_work(struct work_struct *work)
pLed->CurrLedState = LED_BLINK_NORMAL;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
} else {
- pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
}
@@ -142,7 +140,6 @@ static void blink_work(struct work_struct *work)
pLed->CurrLedState = LED_BLINK_NORMAL;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
} else {
- pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
}
@@ -217,9 +214,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
switch (LedAction) {
case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK:
- if (pLed->bLedNoLinkBlinkInProgress)
- return;
-
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
return;
@@ -227,7 +221,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
- pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
if (pLed->bLedOn)
@@ -245,7 +238,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = true;
@@ -268,7 +260,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = true;
@@ -291,7 +282,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = true;
@@ -309,7 +299,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
cancel_delayed_work(&pLed->blink_work);
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
@@ -324,7 +313,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_STOP_WPS:
cancel_delayed_work(&pLed->blink_work);
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
@@ -342,7 +330,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_STOP_WPS_FAIL:
cancel_delayed_work(&pLed->blink_work);
pLed->bLedWPSBlinkInProgress = false;
- pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
@@ -353,7 +340,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
case LED_CTL_POWER_OFF:
pLed->CurrLedState = RTW_LED_OFF;
pLed->BlinkingLedState = RTW_LED_OFF;
- pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
pLed->bLedBlinkInProgress = false;
pLed->bLedWPSBlinkInProgress = false;
diff --git a/drivers/staging/r8188eu/include/rtw_led.h b/drivers/staging/r8188eu/include/rtw_led.h
index d6b0c1c2f9a2..6a0881990394 100644
--- a/drivers/staging/r8188eu/include/rtw_led.h
+++ b/drivers/staging/r8188eu/include/rtw_led.h
@@ -54,7 +54,6 @@ struct led_priv {
u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
- bool bLedNoLinkBlinkInProgress;
bool bLedLinkBlinkInProgress;
bool bLedScanBlinkInProgress;
struct delayed_work blink_work;
--
2.30.2