staging: r8188eu: summarize two flags checks
authorMartin Kaiser <martin@kaiser.cx>
Sat, 15 Oct 2022 15:24:39 +0000 (17:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Oct 2022 15:35:04 +0000 (17:35 +0200)
Summarize the two statements to check if either WIFI_FW_AUTH_STATE or
WIFI_FW_ASSOC_STATE is set.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20221015152440.232281-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme_ext.c

index 465f51bce0e304631b0d4f9f703cbb99b5ba1dec..09ffecc5b2b3a14968b664d04e2a61c035b7a3c7 100644 (file)
@@ -1500,8 +1500,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
                 *      However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth.
                 *      Added the following code to avoid this case.
                 */
-               if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
-                   (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
+               if (pmlmeinfo->state & (WIFI_FW_AUTH_STATE | WIFI_FW_ASSOC_STATE)) {
                        if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
                                ignore_received_deauth = 1;
                        } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) {