mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-08 21:53:54 +08:00
staging: r8188eu: fix warnings in rtw_p2p
Refactor the code to fix following warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Vihas Makwana <makvihas@gmail.com> Link: https://lore.kernel.org/r/20220517140626.3716-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0458e5428e
commit
801626f71d
@ -872,7 +872,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
||||
}
|
||||
|
||||
psta->dev_name_len = 0;
|
||||
if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(__be16 *)pattr_content)) {
|
||||
if (be16_to_cpu(*(__be16 *)pattr_content) == WPS_ATTR_DEVICE_NAME) {
|
||||
dev_name_len = be16_to_cpu(*(__be16 *)(pattr_content + 2));
|
||||
|
||||
psta->dev_name_len = (sizeof(psta->dev_name) < dev_name_len) ? sizeof(psta->dev_name) : dev_name_len;
|
||||
@ -1213,7 +1213,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
||||
if (attr_content == P2P_STATUS_SUCCESS) {
|
||||
/* Do nothing. */
|
||||
} else {
|
||||
if (P2P_STATUS_FAIL_INFO_UNAVAILABLE == attr_content) {
|
||||
if (attr_content == P2P_STATUS_FAIL_INFO_UNAVAILABLE) {
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_RX_INFOR_NOREADY);
|
||||
} else {
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL);
|
||||
@ -1891,7 +1891,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
||||
|
||||
if (role == P2P_ROLE_DEVICE || role == P2P_ROLE_CLIENT || role == P2P_ROLE_GO) {
|
||||
/* leave IPS/Autosuspend */
|
||||
if (_FAIL == rtw_pwr_wakeup(padapter)) {
|
||||
if (rtw_pwr_wakeup(padapter) == _FAIL) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
@ -1905,7 +1905,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
||||
init_wifidirect_info(padapter, role);
|
||||
|
||||
} else if (role == P2P_ROLE_DISABLE) {
|
||||
if (_FAIL == rtw_pwr_wakeup(padapter)) {
|
||||
if (rtw_pwr_wakeup(padapter) == _FAIL) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user