staging: r8188eu: convert functions to return bool
cover staging: r8188eu: convert functions to return bool
There are many functions which return true/false but are marked as int, uint, s32 etc. Mark them as bool.
Vihas Makwana (16):
staging: r8188eu: mark rtw_is_cckrates_included as bool
staging: r8188eu: mark rtw_is_cckratesonly_included as bool
staging: r8188eu: mark rtw_is_desired_network as bool
staging: r8188eu: mark PS_RDY_CHECK as bool
staging: r8188eu: mark check_indicate_seq as bool
staging: r8188eu: mark enqueue_reorder_recvframe as bool
staging: r8188eu: mark recv_indicatepkts_in_order as bool
staging: r8188eu: mark cckrates_included as bool
staging: r8188eu: mark cckratesonly_included as bool
staging: r8188eu: mark is_basicrate as bool
staging: r8188eu: mark is_ap_in_tkip as bool
staging: r8188eu: mark rtl8188eu_xmitframe_complete as bool
staging: r8188eu: mark check_fwstate as bool
staging: r8188eu: mark IS_MCAST as bool
staging: r8188eu: mark IsFrameTypeCtrl as bool
staging: r8188eu: mark rtw_endofpktfile as bool
drivers/staging/r8188eu/core/rtw_ieee80211.c | 4 ++-- drivers/staging/r8188eu/core/rtw_mlme.c | 2 +- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +- drivers/staging/r8188eu/core/rtw_recv.c | 7 +++---- drivers/staging/r8188eu/core/rtw_wlan_util.c | 8 ++++---- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 2 +- drivers/staging/r8188eu/include/ieee80211.h | 4 ++-- drivers/staging/r8188eu/include/rtl8188e_xmit.h | 2 +- drivers/staging/r8188eu/include/rtw_mlme.h | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 6 +++--- drivers/staging/r8188eu/include/wifi.h | 4 ++-- drivers/staging/r8188eu/include/xmit_osdep.h | 2 +- drivers/staging/r8188eu/os_dep/xmit_linux.c | 2 +- 13 files changed, 23 insertions(+), 24 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/16 staging: r8188eu: mark rtw_is_cckrates_included as bool
Mark rtw_is_cckrates_included as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_ieee80211.c | 2 +- drivers/staging/r8188eu/include/ieee80211.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_ieee80211.c +1 -1
@@ -68,7 +68,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val)return 0 ; } -uint rtw_is_cckrates_included (u8 *rate) +bool rtw_is_cckrates_included (u8 *rate) {u32 i =0 ;
drivers/staging/r8188eu/include/ieee80211.h +1 -1
@@ -872,7 +872,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv);int rtw_get_bit_value_from_ieee_value (u8 val); -uint rtw_is_cckrates_included (u8 *rate); +bool rtw_is_cckrates_included (u8 *rate);uint rtw_is_cckratesonly_included (u8 *rate);
Signature · 1 line
2.30.2
PATCH 2/16 staging: r8188eu: mark rtw_is_cckratesonly_included as bool
In reply to Vihas MakwanaMark rtw_is_cckratesonly_included as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_ieee80211.c | 2 +- drivers/staging/r8188eu/include/ieee80211.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_ieee80211.c +1 -1
@@ -81,7 +81,7 @@ bool rtw_is_cckrates_included(u8 *rate)return false; } -uint rtw_is_cckratesonly_included (u8 *rate) +bool rtw_is_cckratesonly_included (u8 *rate) {u32 i =0 ;
drivers/staging/r8188eu/include/ieee80211.h +1 -1
@@ -874,7 +874,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val);bool rtw_is_cckrates_included (u8 *rate); -uint rtw_is_cckratesonly_included (u8 *rate); +bool rtw_is_cckratesonly_included (u8 *rate);int rtw_check_network_type (unsigned char *rate,int ratelen,int channel);
Signature · 1 line
2.30.2
PATCH 3/16 staging: r8188eu: mark rtw_is_desired_network as bool
In reply to Vihas MakwanaMark rtw_is_desired_network as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_mlme.c +1 -1
@@ -571,7 +571,7 @@ static void rtw_add_network(struct adapter *adapter,/* (3) WMM */ /* (4) HT */ /* (5) others */ -static int rtw_is_desired_network (struct adapter *adapter,struct wlan_network *pnetwork) +static bool rtw_is_desired_network (struct adapter *adapter,struct wlan_network *pnetwork) {struct security_priv *psecuritypriv = &adapter->securitypriv;struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
Signature · 1 line
2.30.2
PATCH 4/16 staging: r8188eu: mark PS_RDY_CHECK as bool
In reply to Vihas MakwanaMark PS_RDY_CHECK as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_pwrctrl.c +1 -1
@@ -151,7 +151,7 @@ static void pwr_state_check_handler(struct timer_list *t)rtw_ps_cmd (padapter); } -static u8 PS_RDY_CHECK (struct adapter *padapter) +static bool PS_RDY_CHECK (struct adapter *padapter) {u32 curr_time, delta_time;struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
Signature · 1 line
2.30.2
PATCH 5/16 staging: r8188eu: mark check_indicate_seq as bool
In reply to Vihas MakwanaMark check_indicate_seq as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_recv.c +1 -1
@@ -1466,7 +1466,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)return ret; } -static int check_indicate_seq (struct recv_reorder_ctrl *preorder_ctrl,u16 seq_num) +static bool check_indicate_seq (struct recv_reorder_ctrl *preorder_ctrl,u16 seq_num) {u8 wsize = preorder_ctrl->wsize_b;u16 wend = (preorder_ctrl->indicate_seq + wsize -1 ) &0xFFF ;/* 4096; */
Signature · 1 line
2.30.2
PATCH 6/16 staging: r8188eu: mark enqueue_reorder_recvframe as bool
In reply to Vihas MakwanaMark enqueue_reorder_recvframe as bool as it returns true/false. Also, make it static as it's only used in rtw_recv.
--- drivers/staging/r8188eu/core/rtw_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_recv.c +1 -2
@@ -1496,8 +1496,7 @@ static bool check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_return true; } -int enqueue_reorder_recvframe (struct recv_reorder_ctrl *preorder_ctrl,struct recv_frame *prframe); -int enqueue_reorder_recvframe (struct recv_reorder_ctrl *preorder_ctrl,struct recv_frame *prframe) +static bool enqueue_reorder_recvframe (struct recv_reorder_ctrl *preorder_ctrl,struct recv_frame *prframe) {struct rx_pkt_attrib *pattrib = &prframe->attrib;struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
Signature · 1 line
2.30.2
PATCH 7/16 staging: r8188eu: mark recv_indicatepkts_in_order as bool
In reply to Vihas MakwanaMark recv_indicatepkts_in_order as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_recv.c +1 -1
@@ -1525,7 +1525,7 @@ static bool enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, sreturn true; } -static int recv_indicatepkts_in_order (struct adapter *padapter,struct recv_reorder_ctrl *preorder_ctrl,int bforced) +static bool recv_indicatepkts_in_order (struct adapter *padapter,struct recv_reorder_ctrl *preorder_ctrl,int bforced) {struct list_head *phead, *plist;struct recv_frame *prframe;
Signature · 1 line
2.30.2
PATCH 8/16 staging: r8188eu: mark cckrates_included as bool
In reply to Vihas MakwanaMark cckrates_included as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +1 -1
@@ -45,7 +45,7 @@ static u8 rtw_basic_rate_mix[7] = { IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK }; -int cckrates_included (unsigned char *rate,int ratelen) +bool cckrates_included (unsigned char *rate,int ratelen) {int i;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +1 -1
@@ -632,7 +632,7 @@ void addba_timer_hdl(struct sta_info *psta);_set_timer (&(mlmeext)->link_timer, (ms)); \ }while (0 ) -int cckrates_included(unsigned char *rate, int ratelen); +bool cckrates_included(unsigned char *rate, int ratelen);int cckratesonly_included (unsigned char *rate,int ratelen);void process_addba_req (struct adapter *padapter,u8 *paddba_req,u8 *addr);
Signature · 1 line
2.30.2
PATCH 9/16 staging: r8188eu: mark cckratesonly_included as bool
In reply to Vihas MakwanaMark cckratesonly_included as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +1 -1
@@ -57,7 +57,7 @@ bool cckrates_included(unsigned char *rate, int ratelen)return false; } -int cckratesonly_included (unsigned char *rate,int ratelen) +bool cckratesonly_included (unsigned char *rate,int ratelen) {int i;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +1 -1
@@ -633,7 +633,7 @@ void addba_timer_hdl(struct sta_info *psta); }while (0 ) bool cckrates_included(unsigned char *rate, int ratelen); -int cckratesonly_included (unsigned char *rate,int ratelen); +bool cckratesonly_included (unsigned char *rate,int ratelen);void process_addba_req (struct adapter *padapter,u8 *paddba_req,u8 *addr);
Signature · 1 line
2.30.2
PATCH 10/16 staging: r8188eu: mark is_basicrate as bool
In reply to Vihas MakwanaMark is_basicrate as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +1 -1
@@ -167,7 +167,7 @@ static unsigned char ratetbl_val_2wifirate(unsigned char rate)return val; } -static int is_basicrate (struct adapter *padapter,unsigned char rate) +static bool is_basicrate (struct adapter *padapter,unsigned char rate) {int i;unsigned char val;
Signature · 1 line
2.30.2
PATCH 11/16 staging: r8188eu: mark is_ap_in_tkip as bool
In reply to Vihas MakwanaMark is_ap_in_tkip as bool as it returns true/false.
--- drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +1 -1
@@ -1013,7 +1013,7 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru } } -unsigned int is_ap_in_tkip (struct adapter *padapter) +bool is_ap_in_tkip (struct adapter *padapter) {u32 i;struct ndis_802_11_var_ie *pIE;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +1 -1
@@ -508,7 +508,7 @@ unsigned int receive_disconnect(struct adapter *padapter,unsigned char get_highest_rate_idx (u32 mask);int support_short_GI (struct adapter *padapter,struct HT_caps_element *caps); -unsigned int is_ap_in_tkip (struct adapter *padapter); +bool is_ap_in_tkip (struct adapter *padapter);void report_join_res (struct adapter *padapter,int res);void report_survey_event (struct adapter *padapter,struct recv_frame *precv_frame);
Signature · 1 line
2.30.2
PATCH 12/16 staging: r8188eu: mark rtl8188eu_xmitframe_complete as bool
In reply to Vihas MakwanaMark rtl8188eu_xmitframe_complete as bool as it returns true/false.
--- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 2 +- drivers/staging/r8188eu/include/rtl8188e_xmit.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +1 -1
@@ -376,7 +376,7 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)return len; } -s32 rtl8188eu_xmitframe_complete (struct adapter *adapt,struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf) +bool rtl8188eu_xmitframe_complete (struct adapter *adapt,struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf) {struct dvobj_priv *pdvobjpriv =adapter_to_dvobj (adapt);struct xmit_frame *pxmitframe =NULL ;
drivers/staging/r8188eu/include/rtl8188e_xmit.h +1 -1
@@ -143,7 +143,7 @@ s32 rtl8188eu_mgnt_xmit(struct adapter *padapter, struct xmit_frame *frame);s32 rtl8188eu_xmit_buf_handler (struct adapter *padapter);#define hal_xmit_handler rtl8188eu_xmit_buf_handlervoid rtl8188eu_xmit_tasklet (unsigned long priv); -s32 rtl8188eu_xmitframe_complete (struct adapter *padapter, +bool rtl8188eu_xmitframe_complete (struct adapter *padapter,struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf);
Signature · 1 line
2.30.2
PATCH 13/16 staging: r8188eu: mark check_fwstate as bool
In reply to Vihas MakwanaMark check_fwstate as bool as it returns true/false.
--- drivers/staging/r8188eu/include/rtw_mlme.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/include/rtw_mlme.h +1 -1
@@ -451,7 +451,7 @@ static inline u8 *get_bssid(struct mlme_priv *pmlmepriv)return pmlmepriv->cur_network.network.MacAddress; } -static inline int check_fwstate (struct mlme_priv *pmlmepriv,int state) +static inline bool check_fwstate (struct mlme_priv *pmlmepriv,int state) {if (pmlmepriv->fw_state & state)return true;
Signature · 1 line
2.30.2
PATCH 14/16 staging: r8188eu: mark IS_MCAST as bool
In reply to Vihas MakwanaMark IS_MCAST as bool as it returns true/false.
--- drivers/staging/r8188eu/include/wifi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/include/wifi.h +1 -1
@@ -295,7 +295,7 @@ enum WIFI_REG_DOMAIN {#define GetAddr4Ptr (pbuf) ((unsigned char *)((size_t)(pbuf) + 24)) -static inline int IS_MCAST (unsigned char *da) +static inline bool IS_MCAST (unsigned char *da) {if ((*da) &0x01 )return true;
Signature · 1 line
2.30.2
PATCH 15/16 staging: r8188eu: mark IsFrameTypeCtrl as bool
In reply to Vihas MakwanaMark IsFrameTypeCtrl as bool as it returns true/false.
--- drivers/staging/r8188eu/include/wifi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/include/wifi.h +1 -1
@@ -372,7 +372,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)return sa; } -static inline int IsFrameTypeCtrl (unsigned char *pframe) +static inline bool IsFrameTypeCtrl (unsigned char *pframe) {if (WIFI_CTRL_TYPE ==GetFrameType (pframe))return true;
Signature · 1 line
2.30.2
PATCH 16/16 staging: r8188eu: mark rtw_endofpktfile as bool
In reply to Vihas MakwanaMark rtw_endofpktfile as bool as it returns true/false.
--- drivers/staging/r8188eu/include/xmit_osdep.h | 2 +- drivers/staging/r8188eu/os_dep/xmit_linux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/include/xmit_osdep.h +1 -1
@@ -40,7 +40,7 @@ void rtw_os_xmit_resource_free(struct adapter *padapter,uint rtw_remainder_len (struct pkt_file *pfile);void _rtw_open_pktfile (struct sk_buff *pkt,struct pkt_file *pfile);uint _rtw_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen); -int rtw_endofpktfile (struct pkt_file *pfile); +bool rtw_endofpktfile (struct pkt_file *pfile);void rtw_os_pkt_complete (struct adapter *padapter,struct sk_buff *pkt); void rtw_os_xmit_complete(struct adapter *padapter,
drivers/staging/r8188eu/os_dep/xmit_linux.c +1 -1
@@ -54,7 +54,7 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)return len; } -int rtw_endofpktfile (struct pkt_file *pfile) +bool rtw_endofpktfile (struct pkt_file *pfile) {if (pfile->pkt_len ==0 ) {
Signature · 1 line
2.30.2
Quoted 12 lines · Vihas Makwana
There are many functions which return true/false but are marked as int, uint, s32 etc. Mark them as bool.
Vihas Makwana (16):
staging: r8188eu: markrtw_is_cckrates_includedas bool
staging: r8188eu: markrtw_is_cckratesonly_includedas bool
staging: r8188eu: markrtw_is_desired_networkas bool
staging: r8188eu: markPS_RDY_CHECKas bool
staging: r8188eu: markcheck_indicate_seqas bool
staging: r8188eu: markenqueue_reorder_recvframeas bool
staging: r8188eu: markrecv_indicatepkts_in_orderas bool
staging: r8188eu: markcckrates_includedas bool
Quoted 9 lines
staging: r8188eu: mark
cckratesonly_includedas bool
staging: r8188eu: markis_basicrateas bool
staging: r8188eu: markis_ap_in_tkipas bool
staging: r8188eu: markrtl8188eu_xmitframe_completeas bool
staging: r8188eu: markcheck_fwstateas bool
staging: r8188eu: markIS_MCASTas bool
staging: r8188eu: mark IsFrameTypeCtrl as bool
staging: r8188eu: markrtw_endofpktfileas bool
Looks good. Thanks!
regards,
dan carpenter