staging: r8188eu: clean up blinking macros
authorMartin Kaiser <martin@kaiser.cx>
Sun, 26 Dec 2021 19:55:43 +0000 (20:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Dec 2021 16:12:34 +0000 (17:12 +0100)
Clean up the macros that check the blinking mode of a LED.

The macro IS_LED_BLINKING is not used and can be removed.

The IS_LED_WPS_BLINKING macro is used only by rtw_led.c. Move the macro
into this file. The macro parameter is always a struct LED_871x *,
there's no need for a cast. Rename the parameter to l and put it in
parentheses, which is good practice for macro parameters.

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

index 517aef664bfcfa78290243ea4b4ac3ae575960da..63b811cba277c64f1dbf6f2e0ee8204f0d5519ea 100644 (file)
@@ -5,6 +5,11 @@
 #include "../include/rtw_led.h"
 #include "../include/rtl8188e_spec.h"
 
+#define IS_LED_WPS_BLINKING(l) \
+       ((l)->CurrLedState == LED_BLINK_WPS || \
+       (l)->CurrLedState == LED_BLINK_WPS_STOP || \
+       (l)->bLedWPSBlinkInProgress)
+
 static void ResetLedStatus(struct LED_871x *pLed)
 {
        pLed->CurrLedState = RTW_LED_OFF; /*  Current LED state. */
index cd9e40aa7c657d09cc3f71fddc2aeeaaad5e2057..69656da76d19a5ee8ab95930feeddf15bfde9d0e 100644 (file)
@@ -74,15 +74,6 @@ struct LED_871x {
        struct delayed_work blink_work;
 };
 
-#define IS_LED_WPS_BLINKING(_LED_871x)                                 \
-       (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS || \
-       ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP || \
-       ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
-
-#define IS_LED_BLINKING(_LED_871x)                                     \
-       (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress ||      \
-       ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
-
 void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE      LedAction);
 
 struct led_priv{