All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8192u: bool tests don't need comparisons
@ 2015-06-23 12:52 Luis de Bethencourt
  2015-06-23 12:56 ` Frans Klaver
  2015-06-23 13:04 ` Frans Klaver
  0 siblings, 2 replies; 10+ messages in thread
From: Luis de Bethencourt @ 2015-06-23 12:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

Remove explicit true/false comparations to bool variables.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
---
 drivers/staging/rtl8192u/r8192U_core.c |  7 ++++---
 drivers/staging/rtl8192u/r8192U_dm.c   | 21 +++++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index a4795af..c53d670 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	struct ieee80211_device *ieee = priv->ieee80211;
 
-	if (ieee->bHalfWirelessN24GMode == true)
+	if (ieee->bHalfWirelessN24GMode)
 		Reval = true;
 	else
 		Reval =  false;
@@ -2762,7 +2762,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
 	//
 #ifdef TO_DO_LIST
 	if (Adapter->ResetProgress == RESET_TYPE_NORESET) {
-		if (pMgntInfo->RegRfOff == true) { /* User disable RF via registry. */
+		if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */
 			RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff ----------\n"));
 			MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW);
 			// Those actions will be discard in MgntActSet_RF_State because of the same state
@@ -4406,7 +4406,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
 	/* RTL8190 set this bit to indicate that Hw does not decrypt packet */
 	stats->Decrypted = !desc->SWDec;
 
-	if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP))
+	if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) &&
+	    (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP))
 		stats->bHwError = false;
 	else
 		stats->bHwError = stats->bCRC|stats->bICV;
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 12dd19e..9946615 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev)
 
 	if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable)
 		return;
-	if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { /* If send packets in 40 Mhz in 20/40 */
+	if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If send packets in 40 Mhz in 20/40 */
 		if (priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz)
 			priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true;
 	} else { /* in force send packets in 20 Mhz in 20/40 */
@@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
 					break;
 				}
 			}
-			if (viviflag == true) {
+			if (viviflag) {
 				write_nic_byte(dev, 0x1ba, 0);
 				viviflag = false;
 				RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n");
@@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work)
 	struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq);
 	struct net_device *dev = priv->ieee80211->dev;
 
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_TXPowerTrackingCallback_TSSI(dev);
 	else
 		dm_TXPowerTrackingCallback_ThermalMeter(dev);
@@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_InitializeTXPowerTracking_TSSI(dev);
 	else
 		dm_InitializeTXPowerTracking_ThermalMeter(dev);
@@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev)
 #ifdef RTL8190P
 	dm_CheckTXPowerTracking_TSSI(dev);
 #else
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_CheckTXPowerTracking_TSSI(dev);
 	else
 		dm_CheckTXPowerTracking_ThermalMeter(dev);
@@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14)
 {	/*  dm_CCKTxPowerAdjust */
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_CCKTxPowerAdjust_TSSI(dev, binch14);
 	else
 		dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14);
@@ -1731,7 +1731,7 @@ static void dm_dig_init(struct net_device *dev)
  *---------------------------------------------------------------------------*/
 static void dm_ctrl_initgain_byrssi(struct net_device *dev)
 {
-	if (dm_digtable.dig_enable_flag == false)
+	if (!dm_digtable.dig_enable_flag)
 		return;
 
 	if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
@@ -1750,7 +1750,7 @@ static void dm_ctrl_initgain_byrssi_by_driverrssi(
 	u8 i;
 	static u8	fw_dig;
 
-	if (dm_digtable.dig_enable_flag == false)
+	if (!dm_digtable.dig_enable_flag)
 		return;
 
 	/*DbgPrint("Dig by Sw Rssi\n");*/
@@ -1792,7 +1792,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm(
 	static u32 reset_cnt;
 	u8 i;
 
-	if (dm_digtable.dig_enable_flag == false)
+	if (!dm_digtable.dig_enable_flag)
 		return;
 
 	if (dm_digtable.dig_algorithm_switch) {
@@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
 			priv->bDynamicTxLowPower = false;
 		} else {
 			/* high power state check */
-			if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
+			if (priv->undecorated_smoothed_pwdb <
+			    txlowpower_threshold && priv->bDynamicTxHighPower)
 				priv->bDynamicTxHighPower = false;
 
 			/* low power state check */
-- 
2.1.4


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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 12:52 [PATCH] staging: rtl8192u: bool tests don't need comparisons Luis de Bethencourt
@ 2015-06-23 12:56 ` Frans Klaver
  2015-06-23 13:05   ` Luis de Bethencourt
  2015-06-23 13:04 ` Frans Klaver
  1 sibling, 1 reply; 10+ messages in thread
From: Frans Klaver @ 2015-06-23 12:56 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt
<luis@debethencourt.com> wrote:
> Remove explicit true/false comparations to bool variables.
>
> Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
> ---
>  drivers/staging/rtl8192u/r8192U_core.c |  7 ++++---
>  drivers/staging/rtl8192u/r8192U_dm.c   | 21 +++++++++++----------
>  2 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index a4795af..c53d670 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
>         struct r8192_priv *priv = ieee80211_priv(dev);
>         struct ieee80211_device *ieee = priv->ieee80211;
>
> -       if (ieee->bHalfWirelessN24GMode == true)
> +       if (ieee->bHalfWirelessN24GMode)
>                 Reval = true;
>         else
>                 Reval =  false;

With this one I'd go as far as saying that

Reval = ieee->bHalfWirelessN24GMode;

Frans

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 12:52 [PATCH] staging: rtl8192u: bool tests don't need comparisons Luis de Bethencourt
  2015-06-23 12:56 ` Frans Klaver
@ 2015-06-23 13:04 ` Frans Klaver
  2015-06-23 13:21   ` Luis de Bethencourt
  1 sibling, 1 reply; 10+ messages in thread
From: Frans Klaver @ 2015-06-23 13:04 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt
<luis@debethencourt.com> wrote:
> Remove explicit true/false comparations to bool variables.
>
> Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
> ---
>  drivers/staging/rtl8192u/r8192U_core.c |  7 ++++---
>  drivers/staging/rtl8192u/r8192U_dm.c   | 21 +++++++++++----------
>  2 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index a4795af..c53d670 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
>         struct r8192_priv *priv = ieee80211_priv(dev);
>         struct ieee80211_device *ieee = priv->ieee80211;
>
> -       if (ieee->bHalfWirelessN24GMode == true)
> +       if (ieee->bHalfWirelessN24GMode)
>                 Reval = true;
>         else
>                 Reval =  false;
> @@ -2762,7 +2762,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
>         //
>  #ifdef TO_DO_LIST
>         if (Adapter->ResetProgress == RESET_TYPE_NORESET) {
> -               if (pMgntInfo->RegRfOff == true) { /* User disable RF via registry. */
> +               if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */
>                         RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff ----------\n"));
>                         MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW);
>                         // Those actions will be discard in MgntActSet_RF_State because of the same state
> @@ -4406,7 +4406,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
>         /* RTL8190 set this bit to indicate that Hw does not decrypt packet */
>         stats->Decrypted = !desc->SWDec;
>
> -       if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP))
> +       if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) &&
> +           (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP))
>                 stats->bHwError = false;
>         else
>                 stats->bHwError = stats->bCRC|stats->bICV;
> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
> index 12dd19e..9946615 100644
> --- a/drivers/staging/rtl8192u/r8192U_dm.c
> +++ b/drivers/staging/rtl8192u/r8192U_dm.c
> @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev)
>
>         if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable)
>                 return;
> -       if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { /* If send packets in 40 Mhz in 20/40 */
> +       if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If send packets in 40 Mhz in 20/40 */
>                 if (priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz)
>                         priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true;
>         } else { /* in force send packets in 20 Mhz in 20/40 */
> @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
>                                         break;
>                                 }
>                         }
> -                       if (viviflag == true) {
> +                       if (viviflag) {
>                                 write_nic_byte(dev, 0x1ba, 0);
>                                 viviflag = false;
>                                 RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n");
> @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work)
>         struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq);
>         struct net_device *dev = priv->ieee80211->dev;
>
> -       if (priv->bDcut == true)
> +       if (priv->bDcut)
>                 dm_TXPowerTrackingCallback_TSSI(dev);
>         else
>                 dm_TXPowerTrackingCallback_ThermalMeter(dev);
> @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev)
>  {
>         struct r8192_priv *priv = ieee80211_priv(dev);
>
> -       if (priv->bDcut == true)
> +       if (priv->bDcut)
>                 dm_InitializeTXPowerTracking_TSSI(dev);
>         else
>                 dm_InitializeTXPowerTracking_ThermalMeter(dev);
> @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev)
>  #ifdef RTL8190P
>         dm_CheckTXPowerTracking_TSSI(dev);
>  #else
> -       if (priv->bDcut == true)
> +       if (priv->bDcut)
>                 dm_CheckTXPowerTracking_TSSI(dev);
>         else
>                 dm_CheckTXPowerTracking_ThermalMeter(dev);
> @@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14)
>  {      /*  dm_CCKTxPowerAdjust */
>         struct r8192_priv *priv = ieee80211_priv(dev);
>
> -       if (priv->bDcut == true)
> +       if (priv->bDcut)
>                 dm_CCKTxPowerAdjust_TSSI(dev, binch14);
>         else
>                 dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14);
> @@ -1731,7 +1731,7 @@ static void dm_dig_init(struct net_device *dev)
>   *---------------------------------------------------------------------------*/
>  static void dm_ctrl_initgain_byrssi(struct net_device *dev)
>  {
> -       if (dm_digtable.dig_enable_flag == false)
> +       if (!dm_digtable.dig_enable_flag)
>                 return;
>
>         if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
> @@ -1750,7 +1750,7 @@ static void dm_ctrl_initgain_byrssi_by_driverrssi(
>         u8 i;
>         static u8       fw_dig;
>
> -       if (dm_digtable.dig_enable_flag == false)
> +       if (!dm_digtable.dig_enable_flag)
>                 return;
>
>         /*DbgPrint("Dig by Sw Rssi\n");*/
> @@ -1792,7 +1792,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm(
>         static u32 reset_cnt;
>         u8 i;
>
> -       if (dm_digtable.dig_enable_flag == false)
> +       if (!dm_digtable.dig_enable_flag)
>                 return;
>
>         if (dm_digtable.dig_algorithm_switch) {
> @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
>                         priv->bDynamicTxLowPower = false;
>                 } else {
>                         /* high power state check */
> -                       if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
> +                       if (priv->undecorated_smoothed_pwdb <
> +                           txlowpower_threshold && priv->bDynamicTxHighPower)
>                                 priv->bDynamicTxHighPower = false;

Oh, this has a misleading air hanging over it. It focuses the eyes on
"txlowpower_threshold && priv->bDynamicTxHighPower", while that
probably isn't the intent.

Frans

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 12:56 ` Frans Klaver
@ 2015-06-23 13:05   ` Luis de Bethencourt
  0 siblings, 0 replies; 10+ messages in thread
From: Luis de Bethencourt @ 2015-06-23 13:05 UTC (permalink / raw)
  To: Frans Klaver
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 02:56:38PM +0200, Frans Klaver wrote:
> On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt
> <luis@debethencourt.com> wrote:
> > Remove explicit true/false comparations to bool variables.
> >
> > Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
> > ---
> >  drivers/staging/rtl8192u/r8192U_core.c |  7 ++++---
> >  drivers/staging/rtl8192u/r8192U_dm.c   | 21 +++++++++++----------
> >  2 files changed, 15 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> > index a4795af..c53d670 100644
> > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
> >         struct r8192_priv *priv = ieee80211_priv(dev);
> >         struct ieee80211_device *ieee = priv->ieee80211;
> >
> > -       if (ieee->bHalfWirelessN24GMode == true)
> > +       if (ieee->bHalfWirelessN24GMode)
> >                 Reval = true;
> >         else
> >                 Reval =  false;
> 
> With this one I'd go as far as saying that
> 
> Reval = ieee->bHalfWirelessN24GMode;
> 
> Frans

Completely missed that. Good catch.

Thanks for the review! Sending an updated version now.

Luis

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 13:04 ` Frans Klaver
@ 2015-06-23 13:21   ` Luis de Bethencourt
  2015-06-23 13:37     ` Frans Klaver
  0 siblings, 1 reply; 10+ messages in thread
From: Luis de Bethencourt @ 2015-06-23 13:21 UTC (permalink / raw)
  To: Frans Klaver
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 03:04:32PM +0200, Frans Klaver wrote:
> On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt
> <luis@debethencourt.com> wrote:
> > Remove explicit true/false comparations to bool variables.
> >
> > Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
> > ---
> >  drivers/staging/rtl8192u/r8192U_core.c |  7 ++++---
> >  drivers/staging/rtl8192u/r8192U_dm.c   | 21 +++++++++++----------
> >  2 files changed, 15 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> > index a4795af..c53d670 100644
> > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
> >         struct r8192_priv *priv = ieee80211_priv(dev);
> >         struct ieee80211_device *ieee = priv->ieee80211;
> >
> > -       if (ieee->bHalfWirelessN24GMode == true)
> > +       if (ieee->bHalfWirelessN24GMode)
> >                 Reval = true;
> >         else
> >                 Reval =  false;
> > @@ -2762,7 +2762,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
> >         //
> >  #ifdef TO_DO_LIST
> >         if (Adapter->ResetProgress == RESET_TYPE_NORESET) {
> > -               if (pMgntInfo->RegRfOff == true) { /* User disable RF via registry. */
> > +               if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */
> >                         RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff ----------\n"));
> >                         MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW);
> >                         // Those actions will be discard in MgntActSet_RF_State because of the same state
> > @@ -4406,7 +4406,8 @@ static void query_rxdesc_status(struct sk_buff *skb,
> >         /* RTL8190 set this bit to indicate that Hw does not decrypt packet */
> >         stats->Decrypted = !desc->SWDec;
> >
> > -       if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP))
> > +       if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) &&
> > +           (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP))
> >                 stats->bHwError = false;
> >         else
> >                 stats->bHwError = stats->bCRC|stats->bICV;
> > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
> > index 12dd19e..9946615 100644
> > --- a/drivers/staging/rtl8192u/r8192U_dm.c
> > +++ b/drivers/staging/rtl8192u/r8192U_dm.c
> > @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev)
> >
> >         if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable)
> >                 return;
> > -       if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { /* If send packets in 40 Mhz in 20/40 */
> > +       if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If send packets in 40 Mhz in 20/40 */
> >                 if (priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz)
> >                         priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true;
> >         } else { /* in force send packets in 20 Mhz in 20/40 */
> > @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
> >                                         break;
> >                                 }
> >                         }
> > -                       if (viviflag == true) {
> > +                       if (viviflag) {
> >                                 write_nic_byte(dev, 0x1ba, 0);
> >                                 viviflag = false;
> >                                 RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n");
> > @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work)
> >         struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq);
> >         struct net_device *dev = priv->ieee80211->dev;
> >
> > -       if (priv->bDcut == true)
> > +       if (priv->bDcut)
> >                 dm_TXPowerTrackingCallback_TSSI(dev);
> >         else
> >                 dm_TXPowerTrackingCallback_ThermalMeter(dev);
> > @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev)
> >  {
> >         struct r8192_priv *priv = ieee80211_priv(dev);
> >
> > -       if (priv->bDcut == true)
> > +       if (priv->bDcut)
> >                 dm_InitializeTXPowerTracking_TSSI(dev);
> >         else
> >                 dm_InitializeTXPowerTracking_ThermalMeter(dev);
> > @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev)
> >  #ifdef RTL8190P
> >         dm_CheckTXPowerTracking_TSSI(dev);
> >  #else
> > -       if (priv->bDcut == true)
> > +       if (priv->bDcut)
> >                 dm_CheckTXPowerTracking_TSSI(dev);
> >         else
> >                 dm_CheckTXPowerTracking_ThermalMeter(dev);
> > @@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14)
> >  {      /*  dm_CCKTxPowerAdjust */
> >         struct r8192_priv *priv = ieee80211_priv(dev);
> >
> > -       if (priv->bDcut == true)
> > +       if (priv->bDcut)
> >                 dm_CCKTxPowerAdjust_TSSI(dev, binch14);
> >         else
> >                 dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14);
> > @@ -1731,7 +1731,7 @@ static void dm_dig_init(struct net_device *dev)
> >   *---------------------------------------------------------------------------*/
> >  static void dm_ctrl_initgain_byrssi(struct net_device *dev)
> >  {
> > -       if (dm_digtable.dig_enable_flag == false)
> > +       if (!dm_digtable.dig_enable_flag)
> >                 return;
> >
> >         if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
> > @@ -1750,7 +1750,7 @@ static void dm_ctrl_initgain_byrssi_by_driverrssi(
> >         u8 i;
> >         static u8       fw_dig;
> >
> > -       if (dm_digtable.dig_enable_flag == false)
> > +       if (!dm_digtable.dig_enable_flag)
> >                 return;
> >
> >         /*DbgPrint("Dig by Sw Rssi\n");*/
> > @@ -1792,7 +1792,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm(
> >         static u32 reset_cnt;
> >         u8 i;
> >
> > -       if (dm_digtable.dig_enable_flag == false)
> > +       if (!dm_digtable.dig_enable_flag)
> >                 return;
> >
> >         if (dm_digtable.dig_algorithm_switch) {
> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
> >                         priv->bDynamicTxLowPower = false;
> >                 } else {
> >                         /* high power state check */
> > -                       if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
> > +                       if (priv->undecorated_smoothed_pwdb <
> > +                           txlowpower_threshold && priv->bDynamicTxHighPower)
> >                                 priv->bDynamicTxHighPower = false;
> 
> Oh, this has a misleading air hanging over it. It focuses the eyes on
> "txlowpower_threshold && priv->bDynamicTxHighPower", while that
> probably isn't the intent.
> 
> Frans

I agree, and wasn't sure what the best way to deal with was.

The following doesn't mislead but goes above 80 characters.
			if (priv->undecorated_smoothed_pwdb < txlowpower_threshold &&
			    priv->bDynamicTxHighPower == true)

It is better than the original but it doesn't completely fix it.

If this is a better compromise I can update the patch.

Thanks,
Luis

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 13:21   ` Luis de Bethencourt
@ 2015-06-23 13:37     ` Frans Klaver
  2015-06-23 13:59       ` Luis de Bethencourt
  0 siblings, 1 reply; 10+ messages in thread
From: Frans Klaver @ 2015-06-23 13:37 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt
<luis@debethencourt.com> wrote:

>> >         if (dm_digtable.dig_algorithm_switch) {
>> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
>> >                         priv->bDynamicTxLowPower = false;
>> >                 } else {
>> >                         /* high power state check */
>> > -                       if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
>> > +                       if (priv->undecorated_smoothed_pwdb <
>> > +                           txlowpower_threshold && priv->bDynamicTxHighPower)
>> >                                 priv->bDynamicTxHighPower = false;
>>
>> Oh, this has a misleading air hanging over it. It focuses the eyes on
>> "txlowpower_threshold && priv->bDynamicTxHighPower", while that
>> probably isn't the intent.
>>
>> Frans
>
> I agree, and wasn't sure what the best way to deal with was.
>
> The following doesn't mislead but goes above 80 characters.
>                         if (priv->undecorated_smoothed_pwdb < txlowpower_threshold &&
>                             priv->bDynamicTxHighPower == true)
>
> It is better than the original but it doesn't completely fix it.
>
> If this is a better compromise I can update the patch.

If we keep people's internal parsers working properly, I think having
a line of three characters too long is a fair compromise. Besides
that, there are a lot more lines of code in that file that need to be
brought back to under 80 characters.

If you really care about that line length, precede with a patch (or
two) that changes those insanely long (local!) variable names, so that
you can break up the line right away.

Have fun,
Frans

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 13:37     ` Frans Klaver
@ 2015-06-23 13:59       ` Luis de Bethencourt
  2015-06-23 13:59         ` Frans Klaver
  0 siblings, 1 reply; 10+ messages in thread
From: Luis de Bethencourt @ 2015-06-23 13:59 UTC (permalink / raw)
  To: Frans Klaver
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote:
> On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt
> <luis@debethencourt.com> wrote:
> 
> >> >         if (dm_digtable.dig_algorithm_switch) {
> >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
> >> >                         priv->bDynamicTxLowPower = false;
> >> >                 } else {
> >> >                         /* high power state check */
> >> > -                       if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
> >> > +                       if (priv->undecorated_smoothed_pwdb <
> >> > +                           txlowpower_threshold && priv->bDynamicTxHighPower)
> >> >                                 priv->bDynamicTxHighPower = false;
> >>
> >> Oh, this has a misleading air hanging over it. It focuses the eyes on
> >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that
> >> probably isn't the intent.
> >>
> >> Frans
> >
> > I agree, and wasn't sure what the best way to deal with was.
> >
> > The following doesn't mislead but goes above 80 characters.
> >                         if (priv->undecorated_smoothed_pwdb < txlowpower_threshold &&
> >                             priv->bDynamicTxHighPower == true)
> >
> > It is better than the original but it doesn't completely fix it.
> >
> > If this is a better compromise I can update the patch.
> 
> If we keep people's internal parsers working properly, I think having
> a line of three characters too long is a fair compromise. Besides
> that, there are a lot more lines of code in that file that need to be
> brought back to under 80 characters.
> 
> If you really care about that line length, precede with a patch (or
> two) that changes those insanely long (local!) variable names, so that
> you can break up the line right away.
> 
> Have fun,
> Frans

Very true. There are a *lot* of massively long lines.

This has been a learning experience. I wasn't sure how strict the rules for
submissions were.

There are other things besides line lengths that I want to fix in
rtl8192u. Related to that, I just sent a 3rd version which includes fixes for
these bool comparisons for the rest of the files in drivers/staging/rtl8192u/

Thanks so much for taking the time to review. Appreciated.

Luis

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 13:59       ` Luis de Bethencourt
@ 2015-06-23 13:59         ` Frans Klaver
  2015-06-23 14:19           ` Luis de Bethencourt
  0 siblings, 1 reply; 10+ messages in thread
From: Frans Klaver @ 2015-06-23 13:59 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 3:59 PM, Luis de Bethencourt
<luis@debethencourt.com> wrote:
> On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote:
>> On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt
>> <luis@debethencourt.com> wrote:
>>
>> >> >         if (dm_digtable.dig_algorithm_switch) {
>> >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
>> >> >                         priv->bDynamicTxLowPower = false;
>> >> >                 } else {
>> >> >                         /* high power state check */
>> >> > -                       if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
>> >> > +                       if (priv->undecorated_smoothed_pwdb <
>> >> > +                           txlowpower_threshold && priv->bDynamicTxHighPower)
>> >> >                                 priv->bDynamicTxHighPower = false;
>> >>
>> >> Oh, this has a misleading air hanging over it. It focuses the eyes on
>> >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that
>> >> probably isn't the intent.
>> >>
>> >> Frans
>> >
>> > I agree, and wasn't sure what the best way to deal with was.
>> >
>> > The following doesn't mislead but goes above 80 characters.
>> >                         if (priv->undecorated_smoothed_pwdb < txlowpower_threshold &&
>> >                             priv->bDynamicTxHighPower == true)
>> >
>> > It is better than the original but it doesn't completely fix it.
>> >
>> > If this is a better compromise I can update the patch.
>>
>> If we keep people's internal parsers working properly, I think having
>> a line of three characters too long is a fair compromise. Besides
>> that, there are a lot more lines of code in that file that need to be
>> brought back to under 80 characters.
>>
>> If you really care about that line length, precede with a patch (or
>> two) that changes those insanely long (local!) variable names, so that
>> you can break up the line right away.
>>
>> Have fun,
>> Frans
>
> Very true. There are a *lot* of massively long lines.
>
> This has been a learning experience. I wasn't sure how strict the rules for
> submissions were.

Well, as far as I know "Don't break internal parsers" wins over
"Checkpatch complains". However, checkpatch usually does have a nose
for smelly code (as does sparse, btw), so it pays to look around a bit
if it complains. In the end the maintainer decides whether a patch
passes the criteria.

> There are other things besides line lengths that I want to fix in
> rtl8192u. Related to that, I just sent a 3rd version which includes fixes for
> these bool comparisons for the rest of the files in drivers/staging/rtl8192u/
>
> Thanks so much for taking the time to review. Appreciated.

No problem. Was waiting for a yocto build to finish anyway.

Frans

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

* Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
  2015-06-23 13:59         ` Frans Klaver
@ 2015-06-23 14:19           ` Luis de Bethencourt
  0 siblings, 0 replies; 10+ messages in thread
From: Luis de Bethencourt @ 2015-06-23 14:19 UTC (permalink / raw)
  To: Frans Klaver
  Cc: linux-kernel, Greg Kroah-Hartman, Antoine Schweitzer-Chaput,
	Cristina Opriceana, Aya Mahfouz, Rickard Strandqvist,
	Koray Gulcu, Greg Donald, Lorenzo Stoakes, Ebru Akagunduz,
	Karthik Nayak, devel

On Tue, Jun 23, 2015 at 03:59:41PM +0200, Frans Klaver wrote:
> On Tue, Jun 23, 2015 at 3:59 PM, Luis de Bethencourt
> <luis@debethencourt.com> wrote:
> > On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote:
> >> On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt
> >> <luis@debethencourt.com> wrote:
> >>
> >> >> >         if (dm_digtable.dig_algorithm_switch) {
> >> >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
> >> >> >                         priv->bDynamicTxLowPower = false;
> >> >> >                 } else {
> >> >> >                         /* high power state check */
> >> >> > -                       if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
> >> >> > +                       if (priv->undecorated_smoothed_pwdb <
> >> >> > +                           txlowpower_threshold && priv->bDynamicTxHighPower)
> >> >> >                                 priv->bDynamicTxHighPower = false;
> >> >>
> >> >> Oh, this has a misleading air hanging over it. It focuses the eyes on
> >> >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that
> >> >> probably isn't the intent.
> >> >>
> >> >> Frans
> >> >
> >> > I agree, and wasn't sure what the best way to deal with was.
> >> >
> >> > The following doesn't mislead but goes above 80 characters.
> >> >                         if (priv->undecorated_smoothed_pwdb < txlowpower_threshold &&
> >> >                             priv->bDynamicTxHighPower == true)
> >> >
> >> > It is better than the original but it doesn't completely fix it.
> >> >
> >> > If this is a better compromise I can update the patch.
> >>
> >> If we keep people's internal parsers working properly, I think having
> >> a line of three characters too long is a fair compromise. Besides
> >> that, there are a lot more lines of code in that file that need to be
> >> brought back to under 80 characters.
> >>
> >> If you really care about that line length, precede with a patch (or
> >> two) that changes those insanely long (local!) variable names, so that
> >> you can break up the line right away.
> >>
> >> Have fun,
> >> Frans
> >
> > Very true. There are a *lot* of massively long lines.
> >
> > This has been a learning experience. I wasn't sure how strict the rules for
> > submissions were.
> 
> Well, as far as I know "Don't break internal parsers" wins over
> "Checkpatch complains". However, checkpatch usually does have a nose
> for smelly code (as does sparse, btw), so it pays to look around a bit
> if it complains. In the end the maintainer decides whether a patch
> passes the criteria.
> 

Even if analyzers miss things and give false positives, they are interesting
tools to find interesting code to read and maybe double-check things before
submitting.

> > There are other things besides line lengths that I want to fix in
> > rtl8192u. Related to that, I just sent a 3rd version which includes fixes for
> > these bool comparisons for the rest of the files in drivers/staging/rtl8192u/
> >
> > Thanks so much for taking the time to review. Appreciated.
> 
> No problem. Was waiting for a yocto build to finish anyway.
> 
> Frans

Have fun with yocto!
Luis

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

* [PATCH] Staging: rtl8192u: Bool tests don't need comparisons
@ 2015-03-04 23:07 Cristina Opriceana
  0 siblings, 0 replies; 10+ messages in thread
From: Cristina Opriceana @ 2015-03-04 23:07 UTC (permalink / raw)
  To: outreachy-kernel

This patch removes the following coccinelle warning:
WARNING: Comparison to bool.
It also adds small fixes for some coding style warnings.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 1cc66a1..92e6e7f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1364,12 +1364,10 @@ static void ieee80211_associate_complete_wq(struct work_struct *work)
 		ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
 	}
 	ieee->link_change(ieee->dev);
-	if(ieee->is_silent_reset == 0){
+	if (!ieee->is_silent_reset) {
 		printk("============>normal associate\n");
 	notify_wx_assoc_event(ieee);
-	}
-	else if(ieee->is_silent_reset == 1)
-	{
+	} else if (ieee->is_silent_reset) {
 		printk("==================>silent reset associate\n");
 		ieee->is_silent_reset = false;
 	}
@@ -2053,7 +2051,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
 								ieee->SetWirelessMode(ieee->dev, IEEE_G);
 							}
 
-							if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode == true)
+							if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode)
 							{
 								printk("===============>entern half N mode\n");
 								ieee->bHalfWirelessN24GMode = true;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index acaa723..8e77c6f 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,7 +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 7f0ace1..f84569b 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2822,7 +2822,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/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 167d3b1..307e1d0 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -562,7 +562,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
 					break;
 				}
 			}
-			if (viviflag == true) {
+			if (viviflag) {
 				write_nic_byte(dev, 0x1ba, 0);
 				viviflag = false;
 				RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n");
@@ -765,7 +765,7 @@ void dm_txpower_trackingcallback(struct work_struct *work)
 	struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq);
 	struct net_device *dev = priv->ieee80211->dev;
 
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_TXPowerTrackingCallback_TSSI(dev);
 	else
 		dm_TXPowerTrackingCallback_ThermalMeter(dev);
@@ -1300,7 +1300,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_InitializeTXPowerTracking_TSSI(dev);
 	else
 		dm_InitializeTXPowerTracking_ThermalMeter(dev);
@@ -1356,7 +1356,7 @@ static void dm_check_txpower_tracking(struct net_device *dev)
 #ifdef RTL8190P
 	dm_CheckTXPowerTracking_TSSI(dev);
 #else
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_CheckTXPowerTracking_TSSI(dev);
 	else
 		dm_CheckTXPowerTracking_ThermalMeter(dev);
@@ -1466,7 +1466,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14)
 {	/*  dm_CCKTxPowerAdjust */
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
-	if (priv->bDcut == true)
+	if (priv->bDcut)
 		dm_CCKTxPowerAdjust_TSSI(dev, binch14);
 	else
 		dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14);
@@ -3063,7 +3063,7 @@ static void dm_dynamic_txpower(struct net_device *dev)
 			priv->bDynamicTxLowPower = false;
 		} else {
 			/* high power state check */
-			if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true)
+			if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower)
 				priv->bDynamicTxHighPower = false;
 
 			/* low power state check */
diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
index 1a3a09f..aae30fc 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] 10+ messages in thread

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-23 12:52 [PATCH] staging: rtl8192u: bool tests don't need comparisons Luis de Bethencourt
2015-06-23 12:56 ` Frans Klaver
2015-06-23 13:05   ` Luis de Bethencourt
2015-06-23 13:04 ` Frans Klaver
2015-06-23 13:21   ` Luis de Bethencourt
2015-06-23 13:37     ` Frans Klaver
2015-06-23 13:59       ` Luis de Bethencourt
2015-06-23 13:59         ` Frans Klaver
2015-06-23 14:19           ` Luis de Bethencourt
  -- strict thread matches above, loose matches on Subject: below --
2015-03-04 23:07 [PATCH] Staging: rtl8192u: Bool " Cristina Opriceana

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.