staging: r8188eu: Fix fall-through warnings for Clang
PATCH 1/1 staging: r8188eu: Fix fall-through warnings for Clang
Fix the following fallthrough warnings:
drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
This helps with the ongoing efforts to globally enable -Wimplicit-fallthrough for Clang.
--- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 1 + drivers/staging/r8188eu/core/rtw_wlan_util.c | 3 +++ 2 files changed, 4 insertions(+)
drivers/staging/r8188eu/core/rtw_mlme_ext.c +1 -0
@@ -1495,6 +1495,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_framebreak ;case _ERPINFO_IE_:ERP_IE_handler (padapter, pIE); +break ;default :break ; }
drivers/staging/r8188eu/core/rtw_wlan_util.c +3 -0
@@ -1110,6 +1110,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)case _RSN_IE_2_:if (!memcmp ((pIE->data +8 ),RSN_TKIP_CIPHER ,4 ))return true; +break ;default :break ; }
@@ -1144,6 +1145,7 @@ unsigned int should_forbid_n_rate(struct adapter *padapter)if ((!memcmp ((pIE->data +8 ),RSN_CIPHER_SUITE_CCMP ,4 )) || (!memcmp ((pIE->data +12 ),RSN_CIPHER_SUITE_CCMP ,4 )))return false; +break ;default :break ; }
@@ -1401,6 +1403,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) }else {break ; } +break ;default :break ;
Signature · 1 line
2.27.0
Quoted 7 lines · Gustavo A. R. Silva
Fix the following fallthrough warnings:
drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
Quoted 5 lines
This helps with the ongoing efforts to globally enable -Wimplicit-fallthrough for Clang.
One small comment below.
Quoted 38 lines
--- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 1 + drivers/staging/r8188eu/core/rtw_wlan_util.c | 3 +++ 2 files changed, 4 insertions(+)drivers/staging/r8188eu/core/rtw_mlme_ext.c +1
-0@@ -1495,6 +1495,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_framebreak ;case _ERPINFO_IE_:ERP_IE_handler (padapter, pIE); +break ;default :break ; }drivers/staging/r8188eu/core/rtw_wlan_util.c +2
-0@@ -1110,6 +1110,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)case _RSN_IE_2_:if (!memcmp ((pIE->data +8 ),RSN_TKIP_CIPHER ,4 ))return true; +break ;default :break ; }@@ -1144,6 +1145,7 @@ unsigned int should_forbid_n_rate(struct adapter *padapter)if ((!memcmp ((pIE->data +8 ),RSN_CIPHER_SUITE_CCMP ,4 )) || (!memcmp ((pIE->data +12 ),RSN_CIPHER_SUITE_CCMP ,4 )))return false; +break ;default :break ; }
drivers/staging/r8188eu/core/rtw_wlan_util.c unsigned char check_assoc_AP(u8 *pframe, uint len) · line 1406
Quoted 4 lines
drivers/staging/r8188eu/core/rtw_wlan_util.c +1
-0@@ -1401,6 +1403,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) }else {break ; } +break ;
Would it be better to just remove the else branch at the same time? As far as I can tell, there is no reason to have it.
Quoted 4 lines
drivers/staging/r8188eu/core/rtw_wlan_util.c +0
-0default :break ;