Staging: rtl8723au: rtw_mlme_ext: Remove extra test expression
PATCH 1/1 Staging: rtl8723au: rtw_mlme_ext: Remove extra test expression
Logical and-ing of a struct and its member should be replaced by the member only.
--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/core/rtw_mlme_ext.c +1 -1
@@ -1715,7 +1715,7 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)spin_unlock_bh (&pstapriv->asoc_list_lock);/* now the station is qualified to join our BSS... */ -if (pstat && pstat->state &WIFI_FW_ASSOC_SUCCESS && +if (pstat->state &WIFI_FW_ASSOC_SUCCESS && status ==WLAN_STATUS_SUCCESS ) {/* 1 bss_cap_update & sta_info_update23a */ bss_cap_update_on_sta_join23a (padapter, pstat);
Signature · 1 line
2.1.0
Quoted 13 lines · Shivani Bhardwaj
Logical and-ing of a struct and its member should be replaced by the member only.
Signed-off-by Shivani Bhardwaj <[email protected]>--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723au/core/rtw_mlme_ext.c +0
-0
drivers/staging/rtl8723au/core/rtw_mlme_ext.c OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) · line 1718
Quoted 5 lines
drivers/staging/rtl8723au/core/rtw_mlme_ext.c +1
-1@@ -1715,7 +1715,7 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)spin_unlock_bh (&pstapriv->asoc_list_lock);/* now the station is qualified to join our BSS... */ - if (pstat && pstat->state & WIFI_FW_ASSOC_SUCCESS && + if (pstat->state & WIFI_FW_ASSOC_SUCCESS &&
I don't understand the reasoning here. Are you sure that pstat is not NULL? If you are the transformation is OK, but the commit message should be completely different. If you are not sure that it is not NULL, then the code has to be in the original way.
Furthermore, note that pstat is not being &&d with pstat->state. It is being &&d with pstat->state & WIFI_FW_ASSOC_SUCCESS.
julia
Quoted 13 lines
drivers/staging/rtl8723au/core/rtw_mlme_ext.c +0
-0status == WLAN_STATUS_SUCCESS) {/* 1 bss_cap_update & sta_info_update23a */ bss_cap_update_on_sta_join23a (padapter, pstat);Signature · 8 lines
2.1.0 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151014002245.GA21441%40ubuntu. For more options, visit https://groups.google.com/d/optout.
Quoted 26 lines · Julia Lawall
Quoted 13 lines · Shivani Bhardwaj
Logical and-ing of a struct and its member should be replaced by the member only.
Signed-off-by Shivani Bhardwaj <[email protected]>--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723au/core/rtw_mlme_ext.c +0
-0drivers/staging/rtl8723au/core/rtw_mlme_ext.c OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) · line 1718
Quoted 5 lines
drivers/staging/rtl8723au/core/rtw_mlme_ext.c +1
-1@@ -1715,7 +1715,7 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)spin_unlock_bh (&pstapriv->asoc_list_lock);/* now the station is qualified to join our BSS... */ - if (pstat && pstat->state & WIFI_FW_ASSOC_SUCCESS && + if (pstat->state & WIFI_FW_ASSOC_SUCCESS &&I don't understand the reasoning here. Are you sure that pstat is not NULL? If you are the transformation is OK, but the commit message should be completely different. If you are not sure that it is not NULL, then the code has to be in the original way.
Quoted 5 lines
Furthermore, note that pstat is not being &&d with
pstat->state. It is being &&d withpstat->state&WIFI_FW_ASSOC_SUCCESS.julia
I'm really very sorry. Commit message is wrong. I forgot to mention why it was OK to have just pstate's member instead of pstate, it is because it has already been checked for NULL value before. I am updating commit message and sending v2.
Thank you
Quoted 13 lines
Quoted 13 lines
drivers/staging/rtl8723au/core/rtw_mlme_ext.c +0
-1status == WLAN_STATUS_SUCCESS) {/* 1 bss_cap_update & sta_info_update23a */ bss_cap_update_on_sta_join23a (padapter, pstat); --2.1.0
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151014002245.GA21441%40ubuntu.
For more options, visit https://groups.google.com/d/optout.