All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Bool tests don't need comparisons
@ 2015-03-13 19:17 Cristina Opriceana
  2015-03-13 19:18 ` [PATCH 1/3] Staging: rtl8188eu: " Cristina Opriceana
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Cristina Opriceana @ 2015-03-13 19:17 UTC (permalink / raw)
  To: outreachy-kernel

This patchset removes explicit comparisons involving bool variables.
Warnings detected by coccinelle.

Cristina Opriceana (3):
  Staging: rtl8188eu: Bool tests don't need comparisons
  Staging: rtl8192e: Bool tests don't need comparisons
  Staging: rtl8192u: Bool tests don't need comparisons

 drivers/staging/rtl8188eu/hal/rf_cfg.c             |  2 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c         | 40 +++++++++++-----------
 .../staging/rtl8192u/ieee80211/rtl819x_TSProc.c    |  5 ++-
 drivers/staging/rtl8192u/r8192U_core.c             |  2 +-
 drivers/staging/rtl8192u/r819xU_firmware.c         |  6 ++--
 drivers/staging/rtl8192u/r819xU_phy.c              |  2 +-
 6 files changed, 28 insertions(+), 29 deletions(-)

-- 
1.9.1



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

* [PATCH 1/3] Staging: rtl8188eu: Bool tests don't need comparisons
  2015-03-13 19:17 [PATCH 0/3] Bool tests don't need comparisons Cristina Opriceana
@ 2015-03-13 19:18 ` Cristina Opriceana
  2015-03-14  9:54   ` [Outreachy kernel] " Julia Lawall
  2015-03-13 19:19 ` [PATCH 2/3] Staging: rtl8192e: " Cristina Opriceana
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Cristina Opriceana @ 2015-03-13 19:18 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch simplifies the if condition by removing the comparison to
bool values. It also removes the following coccinelle warning:
"WARNING: Comparison to bool".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rf_cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c
index 455ecdc..954cade 100644
--- a/drivers/staging/rtl8188eu/hal/rf_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c
@@ -295,7 +295,7 @@ static bool rf6052_conf_para(struct adapter *adapt)
 			break;
 		}
 
-		if (rtstatus != true)
+		if (!rtstatus)
 			return false;
 	}
 
-- 
1.9.1



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

* [PATCH 2/3] Staging: rtl8192e: Bool tests don't need comparisons
  2015-03-13 19:17 [PATCH 0/3] Bool tests don't need comparisons Cristina Opriceana
  2015-03-13 19:18 ` [PATCH 1/3] Staging: rtl8188eu: " Cristina Opriceana
@ 2015-03-13 19:19 ` Cristina Opriceana
  2015-03-14  9:48   ` [Outreachy kernel] " Julia Lawall
  2015-03-13 19:21 ` [PATCH 3/3] Staging: rtl8192u: " Cristina Opriceana
  2015-03-13 19:42 ` [Outreachy kernel] [PATCH 0/3] " Jes Sorensen
  3 siblings, 1 reply; 8+ messages in thread
From: Cristina Opriceana @ 2015-03-13 19:19 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch removes comparisons to true/false values on bool variables.
Warning found by coccinelle:
"WARNING: Comparison to bool".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 40 +++++++++++++++---------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index c233a1c..9e65c32 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -67,7 +67,7 @@ static int r8192_wx_set_rate(struct net_device *dev,
 	int ret;
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -87,7 +87,7 @@ static int r8192_wx_set_rts(struct net_device *dev,
 	int ret;
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -115,7 +115,7 @@ static int r8192_wx_set_power(struct net_device *dev,
 	int ret;
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true) {
+	if (priv->bHwRadioOff) {
 		RT_TRACE(COMP_ERR, "%s():Hw is Radio Off, we can't set "
 			 "Power,return\n", __func__);
 		return 0;
@@ -145,7 +145,7 @@ static int r8192_wx_set_rawtx(struct net_device *dev,
 	struct r8192_priv *priv = rtllib_priv(dev);
 	int ret;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -308,7 +308,7 @@ static int r8192_wx_set_debugflag(struct net_device *dev,
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8 c = *extra;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	printk(KERN_INFO "=====>%s(), *extra:%x, debugflag:%x\n", __func__,
@@ -329,7 +329,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
 	enum rt_rf_power_state rtState;
 	int ret;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 	rtState = priv->rtllib->eRFPowerState;
 	down(&priv->wx_sem);
@@ -470,7 +470,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
 			return 0;
 	}
 
-	if (priv->bHwRadioOff == true) {
+	if (priv->bHwRadioOff) {
 		printk(KERN_INFO "================>%s(): hwradio off\n",
 		       __func__);
 		return 0;
@@ -552,7 +552,7 @@ static int r8192_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
 	if (!priv->up)
 		return -ENETDOWN;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 
@@ -572,7 +572,7 @@ static int r8192_wx_set_essid(struct net_device *dev,
 	struct r8192_priv *priv = rtllib_priv(dev);
 	int ret;
 
-	if (priv->bHwRadioOff == true) {
+	if (priv->bHwRadioOff) {
 		printk(KERN_INFO "=========>%s():hw radio off,or Rf state is "
 		       "eRfOff, return\n", __func__);
 		return 0;
@@ -638,7 +638,7 @@ static int r8192_wx_set_freq(struct net_device *dev, struct iw_request_info *a,
 	int ret;
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -665,7 +665,7 @@ static int r8192_wx_set_frag(struct net_device *dev,
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	if (wrqu->frag.disabled)
@@ -704,7 +704,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
 	int ret;
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -754,7 +754,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
 			     {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
 	int i;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	if (!priv->up)
@@ -843,7 +843,7 @@ static int r8192_wx_set_scan_type(struct net_device *dev,
 	int *parms = (int *)p;
 	int mode = parms[0];
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	priv->rtllib->active_scan = mode;
@@ -861,7 +861,7 @@ static int r8192_wx_set_retry(struct net_device *dev,
 	struct r8192_priv *priv = rtllib_priv(dev);
 	int err = 0;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -944,7 +944,7 @@ static int r8192_wx_set_sens(struct net_device *dev,
 
 	short err = 0;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -971,7 +971,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
 	struct r8192_priv *priv = rtllib_priv(dev);
 	struct rtllib_device *ieee = priv->rtllib;
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -1052,7 +1052,7 @@ static int r8192_wx_set_auth(struct net_device *dev,
 
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -1070,7 +1070,7 @@ static int r8192_wx_set_mlme(struct net_device *dev,
 
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
@@ -1087,7 +1087,7 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
 
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->bHwRadioOff == true)
+	if (priv->bHwRadioOff)
 		return 0;
 
 	down(&priv->wx_sem);
-- 
1.9.1



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

* [PATCH 3/3] Staging: rtl8192u: Bool tests don't need comparisons
  2015-03-13 19:17 [PATCH 0/3] Bool tests don't need comparisons Cristina Opriceana
  2015-03-13 19:18 ` [PATCH 1/3] Staging: rtl8188eu: " Cristina Opriceana
  2015-03-13 19:19 ` [PATCH 2/3] Staging: rtl8192e: " Cristina Opriceana
@ 2015-03-13 19:21 ` Cristina Opriceana
  2015-03-13 19:42 ` [Outreachy kernel] [PATCH 0/3] " Jes Sorensen
  3 siblings, 0 replies; 8+ messages in thread
From: Cristina Opriceana @ 2015-03-13 19:21 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch removes explicit true/false comparations to bool variables.
Warning found by coccinelle:
"WARNING: Comparison to bool"

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 5 ++---
 drivers/staging/rtl8192u/r8192U_core.c              | 2 +-
 drivers/staging/rtl8192u/r819xU_firmware.c          | 6 +++---
 drivers/staging/rtl8192u/r819xU_phy.c               | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index acaa723..7505d47 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -288,7 +288,7 @@ static PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee,
 	//for(dir = DIR_UP; dir <= DIR_BI_DIR; dir++)
 	for(dir = 0; dir <= DIR_BI_DIR; dir++)
 	{
-		if(search_dir[dir] ==false )
+		if (!search_dir[dir])
 			continue;
 		list_for_each_entry(pRet, psearch_list, List){
 	//		IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection);
@@ -400,8 +400,7 @@ bool GetTs(
 	}
 	else
 	{
-		if(bAddNewTs == false)
-		{
+		if (!bAddNewTs) {
 			IEEE80211_DEBUG(IEEE80211_DL_TS, "add new TS failed(tid:%d)\n", UP);
 			return false;
 		}
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 8f7a321..8253d1f 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2824,7 +2824,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
 		}
 		dm_initialize_txpower_tracking(dev);
 
-		if (priv->bDcut == true) {
+		if (priv->bDcut) {
 			u32 i, TempCCk;
 			u32 tmpRegA = rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance, bMaskDWord);
 			for (i = 0; i < TxBBGainTableLength; i++) {
diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
index e208c89..d27b1e2 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -281,7 +281,7 @@ bool init_firmware(struct net_device *dev)
 		if (rst_opt == OPT_SYSTEM_RESET)
 			release_firmware(fw_entry);
 
-		if (rt_status != true)
+		if (!rt_status)
 			goto download_firmware_fail;
 
 		switch (init_step) {
@@ -304,7 +304,7 @@ bool init_firmware(struct net_device *dev)
 
 			/* Check Put Code OK and Turn On CPU */
 			rt_status = CPUcheck_maincodeok_turnonCPU(dev);
-			if (rt_status != true) {
+			if (!rt_status) {
 				RT_TRACE(COMP_ERR, "CPUcheck_maincodeok_turnonCPU fail!\n");
 				goto download_firmware_fail;
 			}
@@ -318,7 +318,7 @@ bool init_firmware(struct net_device *dev)
 			mdelay(1);
 
 			rt_status = CPUcheck_firmware_ready(dev);
-			if (rt_status != true) {
+			if (!rt_status) {
 				RT_TRACE(COMP_ERR, "CPUcheck_firmware_ready fail(%d)!\n",rt_status);
 				goto download_firmware_fail;
 			}
diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c
index 084e04f..3451ec7 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.c
+++ b/drivers/staging/rtl8192u/r819xU_phy.c
@@ -1099,7 +1099,7 @@ bool rtl8192_SetRFPowerState(struct net_device *dev,
 	if (eRFPowerState == priv->ieee80211->eRFPowerState)
 		return false;
 
-	if (priv->SetRFPowerStateInProgress == true)
+	if (priv->SetRFPowerStateInProgress)
 		return false;
 
 	priv->SetRFPowerStateInProgress = true;
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH 0/3] Bool tests don't need comparisons
  2015-03-13 19:17 [PATCH 0/3] Bool tests don't need comparisons Cristina Opriceana
                   ` (2 preceding siblings ...)
  2015-03-13 19:21 ` [PATCH 3/3] Staging: rtl8192u: " Cristina Opriceana
@ 2015-03-13 19:42 ` Jes Sorensen
  3 siblings, 0 replies; 8+ messages in thread
From: Jes Sorensen @ 2015-03-13 19:42 UTC (permalink / raw)
  To: Cristina Opriceana, outreachy-kernel

On 03/13/15 15:17, Cristina Opriceana wrote:
> This patchset removes explicit comparisons involving bool variables.
> Warnings detected by coccinelle.
> 
> Cristina Opriceana (3):
>   Staging: rtl8188eu: Bool tests don't need comparisons
>   Staging: rtl8192e: Bool tests don't need comparisons
>   Staging: rtl8192u: Bool tests don't need comparisons
> 
>  drivers/staging/rtl8188eu/hal/rf_cfg.c             |  2 +-
>  drivers/staging/rtl8192e/rtl8192e/rtl_wx.c         | 40 +++++++++++-----------
>  .../staging/rtl8192u/ieee80211/rtl819x_TSProc.c    |  5 ++-
>  drivers/staging/rtl8192u/r8192U_core.c             |  2 +-
>  drivers/staging/rtl8192u/r819xU_firmware.c         |  6 ++--
>  drivers/staging/rtl8192u/r819xU_phy.c              |  2 +-
>  6 files changed, 28 insertions(+), 29 deletions(-)
> 

The patches looks fine, and so do the commit messages.

In general when patching different drivers, I prefer to have different
patch sets posted for it, as it allows the individual driver maintainers
to process them.

Cheers,
Jes



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

* Re: [Outreachy kernel] [PATCH 2/3] Staging: rtl8192e: Bool tests don't need comparisons
  2015-03-13 19:19 ` [PATCH 2/3] Staging: rtl8192e: " Cristina Opriceana
@ 2015-03-14  9:48   ` Julia Lawall
  0 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2015-03-14  9:48 UTC (permalink / raw)
  To: Cristina Opriceana; +Cc: outreachy-kernel



On Fri, 13 Mar 2015, Cristina Opriceana wrote:

> This patch removes comparisons to true/false values on bool variables.
> Warning found by coccinelle:
> "WARNING: Comparison to bool".

It's orthogonal to this patch, but this patch involves a type that is 
uselessly defined as a typedef.  There are a lot of typedefs in that 
header file that could be cleaned up.

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

julia

> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 40 +++++++++++++++---------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> index c233a1c..9e65c32 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> @@ -67,7 +67,7 @@ static int r8192_wx_set_rate(struct net_device *dev,
>  	int ret;
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -87,7 +87,7 @@ static int r8192_wx_set_rts(struct net_device *dev,
>  	int ret;
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -115,7 +115,7 @@ static int r8192_wx_set_power(struct net_device *dev,
>  	int ret;
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true) {
> +	if (priv->bHwRadioOff) {
>  		RT_TRACE(COMP_ERR, "%s():Hw is Radio Off, we can't set "
>  			 "Power,return\n", __func__);
>  		return 0;
> @@ -145,7 +145,7 @@ static int r8192_wx_set_rawtx(struct net_device *dev,
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  	int ret;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -308,7 +308,7 @@ static int r8192_wx_set_debugflag(struct net_device *dev,
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  	u8 c = *extra;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	printk(KERN_INFO "=====>%s(), *extra:%x, debugflag:%x\n", __func__,
> @@ -329,7 +329,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
>  	enum rt_rf_power_state rtState;
>  	int ret;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  	rtState = priv->rtllib->eRFPowerState;
>  	down(&priv->wx_sem);
> @@ -470,7 +470,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
>  			return 0;
>  	}
>  
> -	if (priv->bHwRadioOff == true) {
> +	if (priv->bHwRadioOff) {
>  		printk(KERN_INFO "================>%s(): hwradio off\n",
>  		       __func__);
>  		return 0;
> @@ -552,7 +552,7 @@ static int r8192_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
>  	if (!priv->up)
>  		return -ENETDOWN;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  
> @@ -572,7 +572,7 @@ static int r8192_wx_set_essid(struct net_device *dev,
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  	int ret;
>  
> -	if (priv->bHwRadioOff == true) {
> +	if (priv->bHwRadioOff) {
>  		printk(KERN_INFO "=========>%s():hw radio off,or Rf state is "
>  		       "eRfOff, return\n", __func__);
>  		return 0;
> @@ -638,7 +638,7 @@ static int r8192_wx_set_freq(struct net_device *dev, struct iw_request_info *a,
>  	int ret;
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -665,7 +665,7 @@ static int r8192_wx_set_frag(struct net_device *dev,
>  {
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	if (wrqu->frag.disabled)
> @@ -704,7 +704,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
>  	int ret;
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -754,7 +754,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
>  			     {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
>  	int i;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	if (!priv->up)
> @@ -843,7 +843,7 @@ static int r8192_wx_set_scan_type(struct net_device *dev,
>  	int *parms = (int *)p;
>  	int mode = parms[0];
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	priv->rtllib->active_scan = mode;
> @@ -861,7 +861,7 @@ static int r8192_wx_set_retry(struct net_device *dev,
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  	int err = 0;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -944,7 +944,7 @@ static int r8192_wx_set_sens(struct net_device *dev,
>  
>  	short err = 0;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -971,7 +971,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  	struct rtllib_device *ieee = priv->rtllib;
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -1052,7 +1052,7 @@ static int r8192_wx_set_auth(struct net_device *dev,
>  
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -1070,7 +1070,7 @@ static int r8192_wx_set_mlme(struct net_device *dev,
>  
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> @@ -1087,7 +1087,7 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
>  
>  	struct r8192_priv *priv = rtllib_priv(dev);
>  
> -	if (priv->bHwRadioOff == true)
> +	if (priv->bHwRadioOff)
>  		return 0;
>  
>  	down(&priv->wx_sem);
> -- 
> 1.9.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/0b95bd2fba788a4bb9d9cdbb942bebc6e388aa18.1426273386.git.cristina.opriceana%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


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

* Re: [Outreachy kernel] [PATCH 1/3] Staging: rtl8188eu: Bool tests don't need comparisons
  2015-03-13 19:18 ` [PATCH 1/3] Staging: rtl8188eu: " Cristina Opriceana
@ 2015-03-14  9:54   ` Julia Lawall
  2015-03-14 13:43     ` Cristina Opriceana
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2015-03-14  9:54 UTC (permalink / raw)
  To: Cristina Opriceana; +Cc: outreachy-kernel

On Fri, 13 Mar 2015, Cristina Opriceana wrote:

> This patch simplifies the if condition by removing the comparison to
> bool values. It also removes the following coccinelle warning:
> "WARNING: Comparison to bool".
> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/rf_cfg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c
> index 455ecdc..954cade 100644
> --- a/drivers/staging/rtl8188eu/hal/rf_cfg.c
> +++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c
> @@ -295,7 +295,7 @@ static bool rf6052_conf_para(struct adapter *adapt)
>  			break;
>  		}
>  
> -		if (rtstatus != true)
> +		if (!rtstatus)
>  			return false;

Looking at this code a bit, I can't see how rtstatus could be anything 
other than true.  So perhaps the test, and even the variable, is not 
needed?

julia

>  	}
>  
> -- 
> 1.9.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/89c63fedf7d2979ad94f85a601bc6d8ef80fe142.1426273386.git.cristina.opriceana%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


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

* Re: [Outreachy kernel] [PATCH 1/3] Staging: rtl8188eu: Bool tests don't need comparisons
  2015-03-14  9:54   ` [Outreachy kernel] " Julia Lawall
@ 2015-03-14 13:43     ` Cristina Opriceana
  0 siblings, 0 replies; 8+ messages in thread
From: Cristina Opriceana @ 2015-03-14 13:43 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel



> > diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c
> > index 455ecdc..954cade 100644
> > --- a/drivers/staging/rtl8188eu/hal/rf_cfg.c
> > +++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c
> > @@ -295,7 +295,7 @@ static bool rf6052_conf_para(struct adapter *adapt)
> >  			break;
> >  		}
> >  
> > -		if (rtstatus != true)
> > +		if (!rtstatus)
> >  			return false;
> 
> Looking at this code a bit, I can't see how rtstatus could be anything 
> other than true.  So perhaps the test, and even the variable, is not 
> needed?
> 
> julia
> 

I had a look at it. rtstatus is only modified in
  rtstatus = rtl88e_phy_config_rf_with_headerfile(adapt);

And indeed, this function returns only true.
I will make another patch removing unnecessary code.

 Thanks,
 Cristina



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

end of thread, other threads:[~2015-03-14 13:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 19:17 [PATCH 0/3] Bool tests don't need comparisons Cristina Opriceana
2015-03-13 19:18 ` [PATCH 1/3] Staging: rtl8188eu: " Cristina Opriceana
2015-03-14  9:54   ` [Outreachy kernel] " Julia Lawall
2015-03-14 13:43     ` Cristina Opriceana
2015-03-13 19:19 ` [PATCH 2/3] Staging: rtl8192e: " Cristina Opriceana
2015-03-14  9:48   ` [Outreachy kernel] " Julia Lawall
2015-03-13 19:21 ` [PATCH 3/3] Staging: rtl8192u: " Cristina Opriceana
2015-03-13 19:42 ` [Outreachy kernel] [PATCH 0/3] " Jes Sorensen

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.