Commit 30534c72 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: r8188eu: convert three functions to bool

The functions

is_client_associated_to_ap()
is_client_associated_to_ibss()
is_IBSS_empty()

return boolean values. Convert their return type to bool and replace
_FAIL, which is defined as 0, with false. Another step to get rid of
_SUCCESS / _FAIL.
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221105093916.8255-1-straube.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 38aa1741
...@@ -331,35 +331,35 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss) ...@@ -331,35 +331,35 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss)
return le16_to_cpu(val); return le16_to_cpu(val);
} }
int is_client_associated_to_ap(struct adapter *padapter) bool is_client_associated_to_ap(struct adapter *padapter)
{ {
struct mlme_ext_priv *pmlmeext; struct mlme_ext_priv *pmlmeext;
struct mlme_ext_info *pmlmeinfo; struct mlme_ext_info *pmlmeinfo;
if (!padapter) if (!padapter)
return _FAIL; return false;
pmlmeext = &padapter->mlmeextpriv; pmlmeext = &padapter->mlmeextpriv;
pmlmeinfo = &pmlmeext->mlmext_info; pmlmeinfo = &pmlmeext->mlmext_info;
if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)) if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE))
return true; return true;
else
return _FAIL; return false;
} }
int is_client_associated_to_ibss(struct adapter *padapter) bool is_client_associated_to_ibss(struct adapter *padapter)
{ {
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE))
return true; return true;
else
return _FAIL; return false;
} }
int is_IBSS_empty(struct adapter *padapter) bool is_IBSS_empty(struct adapter *padapter)
{ {
unsigned int i; unsigned int i;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
...@@ -367,7 +367,7 @@ int is_IBSS_empty(struct adapter *padapter) ...@@ -367,7 +367,7 @@ int is_IBSS_empty(struct adapter *padapter)
for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
if (pmlmeinfo->FW_sta_info[i].status == 1) if (pmlmeinfo->FW_sta_info[i].status == 1)
return _FAIL; return false;
} }
return true; return true;
} }
......
...@@ -432,9 +432,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, ...@@ -432,9 +432,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork); u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
u16 get_beacon_interval(struct wlan_bssid_ex *bss); u16 get_beacon_interval(struct wlan_bssid_ex *bss);
int is_client_associated_to_ap(struct adapter *padapter); bool is_client_associated_to_ap(struct adapter *padapter);
int is_client_associated_to_ibss(struct adapter *padapter); bool is_client_associated_to_ibss(struct adapter *padapter);
int is_IBSS_empty(struct adapter *padapter); bool is_IBSS_empty(struct adapter *padapter);
unsigned char check_assoc_AP(u8 *pframe, uint len); unsigned char check_assoc_AP(u8 *pframe, uint len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment