]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: rtl8723bs: use continue statements to reduce indentation
authorMichael Huang <tehsiu.huang@gmail.com>
Sat, 24 Jan 2026 23:15:51 +0000 (15:15 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Jan 2026 14:46:34 +0000 (15:46 +0100)
Refactor nested if-statements using "continue"
statements. This flattens the logic, reduces deep indentation,
and improves overall code readability.

Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260124231557.18189-2-tehsiu.huang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c

index fa1e3ad592541e24597ace73085867e789348603..d80c1a2620e2863edb0a06716f12e66bf2f241d6 100644 (file)
@@ -3684,29 +3684,29 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
 
 
                for (i = 0; i < 8; i++) {
-                       if (ICS[i][0] == 1) {
-                               int j, k = 0;
+                       int j, k = 0;
 
-                               InfoContent[k] = i;
-                               /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */
-                               k++;
+                       if (ICS[i][0] != 1)
+                               continue;
 
-                               for (j = 1; j <= 14; j++) {
-                                       if (ICS[i][j] == 1) {
-                                               if (k < 16) {
-                                                       InfoContent[k] = j; /* channel number */
-                                                       /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */
-                                                       k++;
-                                               }
-                                       }
-                               }
+                       InfoContent[k] = i;
+                       /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */
+                       k++;
 
-                               pframe = rtw_set_ie(pframe, WLAN_EID_BSS_INTOLERANT_CHL_REPORT, k, InfoContent, &(pattrib->pktlen));
+                       for (j = 1; j <= 14; j++) {
+                               if (ICS[i][j] != 1)
+                                       continue;
 
+                               if (k < 16) {
+                                       InfoContent[k] = j; /* channel number */
+                                       /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */
+                                       k++;
+                               }
                        }
 
-               }
+                       pframe = rtw_set_ie(pframe, WLAN_EID_BSS_INTOLERANT_CHL_REPORT, k, InfoContent, &(pattrib->pktlen));
 
+               }
 
        }
 
@@ -3831,14 +3831,16 @@ void site_survey(struct adapter *padapter)
                                int i;
 
                                for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) {
-                                       if (pmlmeext->sitesurvey_res.ssid[i].ssid_length) {
-                                               /* IOT issue, When wifi_spec is not set, send one probe req without WPS IE. */
-                                               if (padapter->registrypriv.wifi_spec)
-                                                       issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
-                                               else
-                                                       issue_probereq_ex(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL, 0, 0, 0, 0);
+                                       if (!pmlmeext->sitesurvey_res.ssid[i].ssid_length)
+                                               continue;
+
+                                       /* IOT issue, When wifi_spec is not set, send one probe req without WPS IE. */
+                                       if (padapter->registrypriv.wifi_spec)
                                                issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
-                                       }
+                                       else
+                                               issue_probereq_ex(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL, 0, 0, 0, 0);
+
+                                       issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
                                }
 
                                if (pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) {