staging: r8188eu: to_fr_ds cannot be 3 here
authorMartin Kaiser <martin@kaiser.cx>
Sun, 3 Apr 2022 16:54:32 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 14:32:42 +0000 (16:32 +0200)
Remove two unnecessary ternary operators in validate_recv_data_frame.
pattrib->to_fr_ds cannot be 3 in these places. If it was 3, we'd already
have returned an error to the caller.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_recv.c

index 200d8c6c6e11c2c3110444b5c4fd8beda15fa670..47d4fd01824f22f663cb450778c088e306185404 100644 (file)
@@ -1001,13 +1001,13 @@ static int validate_recv_data_frame(struct adapter *adapter,
                pattrib->priority = GetPriority((ptr + 24));
                pattrib->ack_policy = GetAckpolicy((ptr + 24));
                pattrib->amsdu = GetAMsdu((ptr + 24));
-               pattrib->hdrlen = pattrib->to_fr_ds == 3 ? 32 : 26;
+               pattrib->hdrlen = 26;
 
                if (pattrib->priority != 0 && pattrib->priority != 3)
                        adapter->recvpriv.bIsAnyNonBEPkts = true;
        } else {
                pattrib->priority = 0;
-               pattrib->hdrlen = pattrib->to_fr_ds == 3 ? 30 : 24;
+               pattrib->hdrlen = 24;
        }
 
        if (pattrib->order)/* HT-CTRL 11n */