staging: rtl8723bs: remove unnecessary else block after return
authorAbraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Tue, 25 Mar 2025 14:42:33 +0000 (15:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Apr 2025 05:38:08 +0000 (06:38 +0100)
The else block after the return statement is unnecessary since
execution does not continue past the return statement.

Remove the else block while preserving logic making the code cleaner
and more readable.

reported by checkpatch:

WARNING: else is not generally useful after a break or return

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Reviewed-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/Z+LA2eeFRL+K0KCy@HP-650
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_mlme.c

index 58de0c2fdd68baca6bfce4d3d91ec989374d2ff7..1d23ea7d6f5971a84fada56f34bc0a771b71d0f2 100644 (file)
@@ -2022,12 +2022,12 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
        }
 
        iEntry = SecIsInPMKIDList(adapter, pmlmepriv->assoc_bssid);
-       if (iEntry < 0) {
+       if (iEntry < 0)
                return ielength;
-       } else {
-               if (authmode == WLAN_EID_RSN)
-                       ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
-       }
+
+       if (authmode == WLAN_EID_RSN)
+               ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
+
        return ielength;
 }