Skip to contentSkip to conversation

Staging: rtl8188eu: core: rtw_mlme.c: Fix unbalanced braces around else.

PATCH In review Sanjana Sanikommu 2 participants 3 messages Mar 18, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8188eu: core: rtw_mlme.c: Fix unbalanced braces around else.

Fix unbalanced braces after else statement.
Issue found by checkpatch.pl semantic patch results for rtw_mlme.c

CHECK: Unbalanced braces around else statement.

---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +2 -2
index ca0cf8a86671..cbee02a86d22 100644
@@ -1111,9 +1111,9 @@ static u8 search_max_mac_id(struct adapter *padapter)
 				break;
 		}
 		mac_id = aid + 1;
-	} else
+	} else {
 #endif
-	{/* adhoc  id =  31~2 */
+/* adhoc  id =  31~2 */
 		for (mac_id = NUM_STA-1; mac_id >= IBSS_START_MAC_ID; mac_id--) {
 			if (pmlmeinfo->FW_sta_info[mac_id].status == 1)
 				break;
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 15 lines · Sanjana Sanikommu

Fix unbalanced braces after else statement.
Issue found by checkpatch.pl semantic patch results for rtw_mlme.c

CHECK: Unbalanced braces around else statement.

---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +0 -0
index ca0cf8a86671..cbee02a86d22 100644

drivers/staging/rtl8188eu/core/rtw_mlme.c static u8 search_max_mac_id(struct adapter *padapter) · line 1116

Quoted 8 lines
drivers/staging/rtl8188eu/core/rtw_mlme.c +2 -2
@@ -1111,9 +1111,9 @@ static u8 search_max_mac_id(struct adapter *padapter)
 				break;
 		}
 		mac_id = aid + 1;
-	} else
+	} else {
 #endif
-	{/* adhoc  id =  31~2 */
+/* adhoc  id =  31~2 */

Never put anything in the first column within a function, unless it is a jump label. This isn't ok, but most importantly, I think you broke the build. The { is in that location for a reason, due to the #endif above it, and can not be changed.

Please always think about the checkpatch changes you are making and do not just blindly do them.

thanks,

greg k-h

#2 lore raw
Quoted 28 lines · gregkh

Review

Quoted 11 lines · Sanjana Sanikommu

Fix unbalanced braces after else statement.
Issue found by checkpatch.pl semantic patch results for rtw_mlme.c

CHECK: Unbalanced braces around else statement.

Signed-off-by Sanjana Sanikommu <[email protected] <javascript:>>

---

 drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 ++-- 
 1 file changed, 2 insertions(+), 2 deletions(-) 
(quoted diff) +0 -0

b/drivers/staging/rtl8188eu/core/rtw_mlme.c

drivers/staging/rtl8188eu/core/rtw_mlme.c static u8 search_max_mac_id(struct adapter

Quoted 4 lines

index ca0cf8a86671..cbee02a86d22 100644

drivers/staging/rtl8188eu/core/rtw_mlme.c +0 -0
@@ -1111,9 +1111,9 @@ static u8 search_max_mac_id(struct adapter 

*padapter)

drivers/staging/rtl8188eu/core/rtw_mlme.c static u8 search_max_mac_id(struct adapter *padapter) · line 1116

Quoted 8 lines
drivers/staging/rtl8188eu/core/rtw_mlme.c +2 -2
                                 break; 
                 } 
                 mac_id = aid + 1; 
-        } else 
+        } else { 
 #endif 
-        {/* adhoc  id =  31~2 */ 
+/* adhoc  id =  31~2 */ 
Quoted 8 lines

Never put anything in the first column within a function, unless it is a jump label. This isn't ok, but most importantly, I think you broke the build. The { is in that location for a reason, due to the #endif above it, and can not be changed.

Please always think about the checkpatch changes you are making and do not just blindly do them.

Thanks for letting me know. I would drop them :)

Sanjana

Quoted 5 lines

thanks,

greg k-h