diff options
author | Vihas Makwana <makvihas@gmail.com> | 2022-05-17 19:36:24 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-19 17:44:43 +0200 |
commit | 801626f71d6f822e0becbfaa8b26a41addea693a (patch) | |
tree | 6fbc362ee1c09fc3a53ff5abdb621d2d96191672 /drivers/staging | |
parent | 0458e5428e5e959d201a40ffe71d762a79ecedc4 (diff) |
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/r8188eu/core/rtw_p2p.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c index 59bb1bd12d59..beffe5b16f1e 100644 --- a/drivers/staging/r8188eu/core/rtw_p2p.c +++ b/drivers/staging/r8188eu/core/rtw_p2p.c @@ -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; } |