2022-03-03 00:07:37

by Vihas Makwana

[permalink] [raw]
Subject: [PATCH 00/16] 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(-)

--
2.30.2


2022-03-03 00:19:52

by Vihas Makwana

[permalink] [raw]
Subject: [PATCH 08/16] staging: r8188eu: mark cckrates_included as bool

Mark cckrates_included as bool as it returns true/false.

Signed-off-by: Vihas Makwana <[email protected]>
---
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(-)

diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index 33c022820..4f58c8970 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -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;

diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
index 26f31f20e..21c7f020a 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
@@ -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);
--
2.30.2

2022-03-03 00:20:56

by Vihas Makwana

[permalink] [raw]
Subject: [PATCH 02/16] staging: r8188eu: mark rtw_is_cckratesonly_included as bool

Mark rtw_is_cckratesonly_included as bool as it returns true/false.

Signed-off-by: Vihas Makwana <[email protected]>
---
drivers/staging/r8188eu/core/rtw_ieee80211.c | 2 +-
drivers/staging/r8188eu/include/ieee80211.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
index a7b7b0f14..5a0e42ed4 100644
--- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
@@ -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;

diff --git a/drivers/staging/r8188eu/include/ieee80211.h b/drivers/staging/r8188eu/include/ieee80211.h
index 1a15db097..8c20363cd 100644
--- a/drivers/staging/r8188eu/include/ieee80211.h
+++ b/drivers/staging/r8188eu/include/ieee80211.h
@@ -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);

--
2.30.2

2022-03-03 00:25:18

by Vihas Makwana

[permalink] [raw]
Subject: [PATCH 11/16] staging: r8188eu: mark is_ap_in_tkip as bool

Mark is_ap_in_tkip as bool as it returns true/false.

Signed-off-by: Vihas Makwana <[email protected]>
---
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(-)

diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index 8e8a82a1e..665b07719 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -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;
diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
index cf397ac68..0c555ea67 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
@@ -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);
--
2.30.2

2022-03-03 00:25:47

by Vihas Makwana

[permalink] [raw]
Subject: [PATCH 10/16] staging: r8188eu: mark is_basicrate as bool

Mark is_basicrate as bool as it returns true/false.

Signed-off-by: Vihas Makwana <[email protected]>
---
drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index eef8523c3..8e8a82a1e 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -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;
--
2.30.2

2022-03-03 00:31:22

by Vihas Makwana

[permalink] [raw]
Subject: [PATCH 03/16] staging: r8188eu: mark rtw_is_desired_network as bool

Mark rtw_is_desired_network as bool as it returns true/false.

Signed-off-by: Vihas Makwana <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 4bb6edcc0..8d36ab955 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -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;
--
2.30.2

2022-03-03 12:39:19

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 00/16] staging: r8188eu: convert functions to return bool

On Thu, Mar 03, 2022 at 02:17:21AM +0530, Vihas Makwana wrote:
> 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
>

Looks good. Thanks!

Reviewed-by: Dan Carpenter <[email protected]>

regards,
dan carpenter