All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: core: Remove true and false comparison
@ 2018-10-08 19:00 Mamta Shukla
  2018-10-08 19:47 ` Larry Finger
  0 siblings, 1 reply; 3+ messages in thread
From: Mamta Shukla @ 2018-10-08 19:00 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: dess, hdegoede, Larry.Finger, gregkh

Remove comparison to true and false in if statement.
Issue found with checkpatch.pl.
CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ap.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index faf4b41..2691241 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -861,7 +861,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
 		update_hw_ht_param(padapter);
 	}
 
-	if (pmlmepriv->cur_network.join_res != true) { /* setting only at  first time */
+	if (!pmlmepriv->cur_network.join_res) { /* setting only at  first time */
 
 		/* WEP Key will be set before this function, do not clear CAM. */
 		if (
@@ -899,7 +899,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
 
 	rtw_hal_set_hwreg(padapter, HW_VAR_DO_IQK, NULL);
 
-	if (pmlmepriv->cur_network.join_res != true) { /* setting only at  first time */
+	if (!pmlmepriv->cur_network.join_res) { /* setting only at  first time */
 
 		/* u32 initialgain; */
 
@@ -992,7 +992,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
 	);
 
 
-	if (true == pmlmeext->bstart_bss) {
+	if (pmlmeext->bstart_bss) {
 
 		update_beacon(padapter, _TIM_IE_, NULL, true);
 
@@ -1047,7 +1047,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
 
 	DBG_871X("%s, len =%d\n", __func__, len);
 
-	if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true)
+	if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
 		return _FAIL;
 
 
@@ -1379,7 +1379,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
 	}
 
 	/* ht_cap */
-	if (pregistrypriv->ht_enable && ht_cap == true) {
+	if (pregistrypriv->ht_enable && ht_cap) {
 
 		pmlmepriv->htpriv.ht_option = true;
 		pmlmepriv->qospriv.qos_option = 1;
@@ -1482,7 +1482,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
 	spin_unlock_bh(&(pacl_node_q->lock));
 
 
-	if (added == true)
+	if (added)
 		return ret;
 
 
@@ -1492,7 +1492,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
 
 		paclnode = &pacl_list->aclnode[i];
 
-		if (paclnode->valid == false) {
+		if (!paclnode->valid) {
 
 			INIT_LIST_HEAD(&paclnode->list);
 
@@ -1547,7 +1547,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
 			!memcmp(baddr, addr, ETH_ALEN)
 		) {
 
-			if (paclnode->valid == true) {
+			if (paclnode->valid) {
 
 				paclnode->valid = false;
 
@@ -1912,7 +1912,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
 	pmlmeext = &(padapter->mlmeextpriv);
 	/* pmlmeinfo = &(pmlmeext->mlmext_info); */
 
-	if (false == pmlmeext->bstart_bss)
+	if (!pmlmeext->bstart_bss)
 		return;
 
 	spin_lock_bh(&pmlmepriv->bcn_update_lock);
@@ -1998,7 +1998,7 @@ static int rtw_ht_operation_update(struct adapter *padapter)
 	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
 	struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
 
-	if (pmlmepriv->htpriv.ht_option == true)
+	if (pmlmepriv->htpriv.ht_option)
 		return 0;
 
 	/* if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) */
@@ -2066,7 +2066,7 @@ static int rtw_ht_operation_update(struct adapter *padapter)
 void associated_clients_update(struct adapter *padapter, u8 updated)
 {
 	/* update associcated stations cap. */
-	if (updated == true) {
+	if (updated) {
 
 		struct list_head	*phead, *plist;
 		struct sta_info *psta = NULL;
@@ -2458,7 +2458,7 @@ void sta_info_update(struct adapter *padapter, struct sta_info *psta)
 		psta->htpriv.ht_option = false;
 	}
 
-	if (pmlmepriv->htpriv.ht_option == false)
+	if (!pmlmepriv->htpriv.ht_option)
 		psta->htpriv.ht_option = false;
 
 	update_sta_info_apmode(padapter, psta);
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: rtl8723bs: core: Remove true and false comparison
  2018-10-08 19:00 [PATCH] staging: rtl8723bs: core: Remove true and false comparison Mamta Shukla
@ 2018-10-08 19:47 ` Larry Finger
  0 siblings, 0 replies; 3+ messages in thread
From: Larry Finger @ 2018-10-08 19:47 UTC (permalink / raw)
  To: Mamta Shukla, outreachy-kernel; +Cc: dess, hdegoede, gregkh

On 10/8/18 2:00 PM, Mamta Shukla wrote:
> Remove comparison to true and false in if statement.
> Issue found with checkpatch.pl.
> CHECK: Using comparison to true is error prone
> CHECK: Using comparison to false is error prone
> 
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> ---
>   drivers/staging/rtl8723bs/core/rtw_ap.c | 24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index faf4b41..2691241 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -861,7 +861,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
>   		update_hw_ht_param(padapter);
>   	}
>   
> -	if (pmlmepriv->cur_network.join_res != true) { /* setting only at  first time */
> +	if (!pmlmepriv->cur_network.join_res) { /* setting only at  first time */
>   
>   		/* WEP Key will be set before this function, do not clear CAM. */
>   		if (
> @@ -899,7 +899,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
>   
>   	rtw_hal_set_hwreg(padapter, HW_VAR_DO_IQK, NULL);
>   
> -	if (pmlmepriv->cur_network.join_res != true) { /* setting only at  first time */
> +	if (!pmlmepriv->cur_network.join_res) { /* setting only at  first time */
>   
>   		/* u32 initialgain; */
>   
> @@ -992,7 +992,7 @@ void start_bss_network(struct adapter *padapter, u8 *pbuf)
>   	);
>   
>   
> -	if (true == pmlmeext->bstart_bss) {
> +	if (pmlmeext->bstart_bss) {
>   
>   		update_beacon(padapter, _TIM_IE_, NULL, true);
>   
> @@ -1047,7 +1047,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>   
>   	DBG_871X("%s, len =%d\n", __func__, len);
>   
> -	if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true)
> +	if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
>   		return _FAIL;
>   
>   
> @@ -1379,7 +1379,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>   	}
>   
>   	/* ht_cap */
> -	if (pregistrypriv->ht_enable && ht_cap == true) {
> +	if (pregistrypriv->ht_enable && ht_cap) {
>   
>   		pmlmepriv->htpriv.ht_option = true;
>   		pmlmepriv->qospriv.qos_option = 1;
> @@ -1482,7 +1482,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
>   	spin_unlock_bh(&(pacl_node_q->lock));
>   
>   
> -	if (added == true)
> +	if (added)
>   		return ret;
>   
>   
> @@ -1492,7 +1492,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
>   
>   		paclnode = &pacl_list->aclnode[i];
>   
> -		if (paclnode->valid == false) {
> +		if (!paclnode->valid) {
>   
>   			INIT_LIST_HEAD(&paclnode->list);
>   
> @@ -1547,7 +1547,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
>   			!memcmp(baddr, addr, ETH_ALEN)
>   		) {
>   
> -			if (paclnode->valid == true) {
> +			if (paclnode->valid) {
>   
>   				paclnode->valid = false;
>   
> @@ -1912,7 +1912,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
>   	pmlmeext = &(padapter->mlmeextpriv);
>   	/* pmlmeinfo = &(pmlmeext->mlmext_info); */
>   
> -	if (false == pmlmeext->bstart_bss)
> +	if (!pmlmeext->bstart_bss)
>   		return;
>   
>   	spin_lock_bh(&pmlmepriv->bcn_update_lock);
> @@ -1998,7 +1998,7 @@ static int rtw_ht_operation_update(struct adapter *padapter)
>   	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
>   	struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
>   
> -	if (pmlmepriv->htpriv.ht_option == true)
> +	if (pmlmepriv->htpriv.ht_option)
>   		return 0;
>   
>   	/* if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) */
> @@ -2066,7 +2066,7 @@ static int rtw_ht_operation_update(struct adapter *padapter)
>   void associated_clients_update(struct adapter *padapter, u8 updated)
>   {
>   	/* update associcated stations cap. */
> -	if (updated == true) {
> +	if (updated) {
>   
>   		struct list_head	*phead, *plist;
>   		struct sta_info *psta = NULL;
> @@ -2458,7 +2458,7 @@ void sta_info_update(struct adapter *padapter, struct sta_info *psta)
>   		psta->htpriv.ht_option = false;
>   	}
>   
> -	if (pmlmepriv->htpriv.ht_option == false)
> +	if (!pmlmepriv->htpriv.ht_option)
>   		psta->htpriv.ht_option = false;
>   
>   	update_sta_info_apmode(padapter, psta);
> 

ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] staging: rtl8723bs: core:  Remove true and false comparison
@ 2021-10-19 17:23 Kushal Kothari
  0 siblings, 0 replies; 3+ messages in thread
From: Kushal Kothari @ 2021-10-19 17:23 UTC (permalink / raw)
  To: gregkh, fabioaiuto83, marcocesati, dan.carpenter, ross.schm.dev,
	linux-staging, linux-kernel, outreachy-kernel, mike.rapoport
  Cc: Kushal Kothari

Remove comparison to true and false in if statement.
Issue found with checkpatch.pl.
CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index efc9b1974e38..b473f1d1ce08 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -309,8 +309,8 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 	if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
 		bAllow = true;
 
-	if ((pcmdpriv->padapter->hw_init_completed == false && bAllow == false)
-		|| atomic_read(&(pcmdpriv->cmdthd_running)) == false	/* com_thread not running */
+	if ((!pcmdpriv->padapter->hw_init_completed && !bAllow)
+		|| !atomic_read(&(pcmdpriv->cmdthd_running))	/* com_thread not running */
 	)
 		return _FAIL;
 
@@ -407,7 +407,7 @@ int rtw_cmd_thread(void *context)
 			break;
 		}
 
-		if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) {
+		if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) {
 			netdev_dbg(padapter->pnetdev,
 				   "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
 				   __func__, padapter->bDriverStopped,
@@ -430,7 +430,7 @@ int rtw_cmd_thread(void *context)
 			continue;
 
 _next:
-		if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) {
+		if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) {
 			netdev_dbg(padapter->pnetdev,
 				   "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
 				   __func__, padapter->bDriverStopped,
@@ -927,7 +927,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
 	else
 		GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
 
-	if (unicast_key == true)
+	if (unicast_key)
 		memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
 	else
 		memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
@@ -1283,7 +1283,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 			(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) {
 			bEnterPS = false;
 
-			if (bBusyTraffic == true) {
+			if (bBusyTraffic) {
 				if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount <= 4)
 					pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 4;
 
@@ -1619,7 +1619,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
 
 	rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
 
-	while (false == empty && jiffies_to_msecs(jiffies - start) < g_wait_hiq_empty) {
+	while (!empty && jiffies_to_msecs(jiffies - start) < g_wait_hiq_empty) {
 		msleep(100);
 		rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
 	}
@@ -2054,7 +2054,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *
 
 	spin_lock_bh(&pmlmepriv->lock);
 
-	if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true))
+	if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)))
 		_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
 
 	set_fwstate(pmlmepriv, _FW_LINKED);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-19 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 19:00 [PATCH] staging: rtl8723bs: core: Remove true and false comparison Mamta Shukla
2018-10-08 19:47 ` Larry Finger
2021-10-19 17:23 Kushal Kothari

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.