linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: net: wireless: rtlwifi: fix bool comparison in expressions
@ 2021-01-08 15:32 Aditya Srivastava
  2021-01-08 19:41 ` Larry Finger
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-08 15:32 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

There are certain conditional expressions in rtlwifi, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g., in drivers/net/wireless/realtek/rtlwifi/ps.c,
"if (find_p2p_ie == true)" can be replaced with "if (find_p2p_ie)"

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
- The changes made are compile tested
- Applies perfecly on next-20210108

 drivers/net/wireless/realtek/rtlwifi/ps.c                 | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c       | 8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c       | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c       | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c      | 8 ++++----
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index f99882255d48..629c03271bde 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -798,9 +798,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
 		ie += 3 + noa_len;
 	}
 
-	if (find_p2p_ie == true) {
+	if (find_p2p_ie) {
 		if ((p2pinfo->p2p_ps_mode > P2P_PS_NONE) &&
-		    (find_p2p_ps_ie == false))
+		    (!find_p2p_ps_ie))
 			rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
index d10c14c694da..6f61d6a10627 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
@@ -474,11 +474,11 @@ static void rtl88e_dm_dig(struct ieee80211_hw *hw)
 	u8 dm_dig_max, dm_dig_min;
 	u8 current_igi = dm_dig->cur_igvalue;
 
-	if (rtlpriv->dm.dm_initialgain_enable == false)
+	if (!rtlpriv->dm.dm_initialgain_enable)
 		return;
-	if (dm_dig->dig_enable_flag == false)
+	if (!dm_dig->dig_enable_flag)
 		return;
-	if (mac->act_scanning == true)
+	if (mac->act_scanning)
 		return;
 
 	if (mac->link_state >= MAC80211_LINKED)
@@ -1637,7 +1637,7 @@ static void rtl88e_dm_fast_ant_training(struct ieee80211_hw *hw)
 			}
 		}
 
-		if (bpkt_filter_match == false) {
+		if (!bpkt_filter_match) {
 			rtl_set_bbreg(hw, DM_REG_TXAGC_A_1_MCS32_11N,
 				      BIT(16), 0);
 			rtl_set_bbreg(hw, DM_REG_IGI_A_11N, BIT(7), 0);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index bd9160b166c5..861cc663ca93 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -1269,12 +1269,12 @@ void rtl88ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
 	if (rtlpriv->psc.rfpwr_state != ERFON)
 		return;
 
-	if (check_bssid == true) {
+	if (check_bssid) {
 		reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
 		rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
 					      (u8 *)(&reg_rcr));
 		_rtl88ee_set_bcn_ctrl_reg(hw, 0, BIT(4));
-	} else if (check_bssid == false) {
+	} else if (!check_bssid) {
 		reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
 		_rtl88ee_set_bcn_ctrl_reg(hw, BIT(4), 0);
 		rtlpriv->cfg->ops->set_hw_reg(hw,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c
index 265a1a336304..0b6a15c2e5cc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c
@@ -380,7 +380,7 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw)
 		initialized = false;
 		dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
 		return;
-	} else if (initialized == false) {
+	} else if (!initialized) {
 		initialized = true;
 		dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_0;
 		dm_digtable->cur_igvalue = 0x20;
@@ -509,7 +509,7 @@ static void rtl92c_dm_dig(struct ieee80211_hw *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 
-	if (rtlpriv->dm.dm_initialgain_enable == false)
+	if (!rtlpriv->dm.dm_initialgain_enable)
 		return;
 	if (!(rtlpriv->dm.dm_flag & DYNAMIC_FUNC_DIG))
 		return;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
index 47fabce5c235..73a5d8a068fc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
@@ -458,7 +458,7 @@ static u8 _rtl92se_halset_sysclk(struct ieee80211_hw *hw, u8 data)
 	tmpvalue = rtl_read_byte(rtlpriv, SYS_CLKR + 1);
 	bresult = ((tmpvalue & BIT(7)) == (data & BIT(7)));
 
-	if ((data & (BIT(6) | BIT(7))) == false) {
+	if (!(data & (BIT(6) | BIT(7)))) {
 		waitcount = 100;
 		tmpvalue = 0;
 
@@ -1268,7 +1268,7 @@ static u8 _rtl92s_set_sysclk(struct ieee80211_hw *hw, u8 data)
 	tmp = rtl_read_byte(rtlpriv, SYS_CLKR + 1);
 	result = ((tmp & BIT(7)) == (data & BIT(7)));
 
-	if ((data & (BIT(6) | BIT(7))) == false) {
+	if (!(data & (BIT(6) | BIT(7)))) {
 		waitcnt = 100;
 		tmp = 0;
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 372d6f8caf06..e214b9062cc1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -1812,7 +1812,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 		return false;
 	}
 	_rtl8821ae_phy_init_tx_power_by_rate(hw);
-	if (rtlefuse->autoload_failflag == false) {
+	if (!rtlefuse->autoload_failflag) {
 		rtstatus = _rtl8821ae_phy_config_bb_with_pgheaderfile(hw,
 						    BASEBAND_CONFIG_PHY_REG);
 	}
@@ -3980,7 +3980,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path)
 				}
 			}
 
-			if (tx0iqkok == false)
+			if (!tx0iqkok)
 				break;				/* TXK fail, Don't do RXK */
 
 			if (vdf_enable == 1) {
@@ -4090,7 +4090,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path)
 						}
 					}
 
-					if (tx0iqkok == false) {   /* If RX mode TXK fail, then take TXK Result */
+					if (!tx0iqkok) {   /* If RX mode TXK fail, then take TXK Result */
 						tx_x0_rxk[cal] = tx_x0[cal];
 						tx_y0_rxk[cal] = tx_y0[cal];
 						tx0iqkok = true;
@@ -4249,7 +4249,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path)
 					}
 				}
 
-				if (tx0iqkok == false) {   /* If RX mode TXK fail, then take TXK Result */
+				if (!tx0iqkok) {   /* If RX mode TXK fail, then take TXK Result */
 					tx_x0_rxk[cal] = tx_x0[cal];
 					tx_y0_rxk[cal] = tx_y0[cal];
 					tx0iqkok = true;
-- 
2.17.1


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

* Re: [PATCH] drivers: net: wireless: rtlwifi: fix bool comparison in expressions
  2021-01-08 15:32 [PATCH] drivers: net: wireless: rtlwifi: fix bool comparison in expressions Aditya Srivastava
@ 2021-01-08 19:41 ` Larry Finger
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
  2021-01-13 17:11   ` [PATCH] drivers: net: wireless: rtlwifi: " Aditya
  0 siblings, 2 replies; 10+ messages in thread
From: Larry Finger @ 2021-01-08 19:41 UTC (permalink / raw)
  To: Aditya Srivastava, linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn

On 1/8/21 9:32 AM, Aditya Srivastava wrote:
> There are certain conditional expressions in rtlwifi, where a boolean
> variable is compared with true/false, in forms such as (foo == true) or
> (false != bar), which does not comply with checkpatch.pl (CHECK:
> BOOL_COMPARISON), according to which boolean variables should be
> themselves used in the condition, rather than comparing with true/false
> 
> E.g., in drivers/net/wireless/realtek/rtlwifi/ps.c,
> "if (find_p2p_ie == true)" can be replaced with "if (find_p2p_ie)"
> 
> Replace all such expressions with the bool variables appropriately
> 
> Signed-off-by: Aditya Srivastava<yashsri421@gmail.com>
> ---
> - The changes made are compile tested
> - Applies perfecly on next-20210108
> 
>   drivers/net/wireless/realtek/rtlwifi/ps.c                 | 4 ++--
>   drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c       | 8 ++++----
>   drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c       | 4 ++--
>   drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c | 4 ++--
>   drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c       | 4 ++--
>   drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c      | 8 ++++----
>   6 files changed, 16 insertions(+), 16 deletions(-)

As has been stated several times, this form of the subject is incorrect. It 
should be: "rtlwifi: <driver_name>: <subject>

I would prefer that there be separate patches for each driver, not that the 
changes be lumped into a single patch as was done here. Such organization makes 
it a lot easier to find the patches for a given driver in case something goes 
wrong.Note: The driver for ps is rtl_pci, and that for rtl8192c is 
rtl8192c-common. The other driver names match their directory.

Larry


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

* [PATCH 0/5] rtlwifi: fix bool comparison in expressions
  2021-01-08 19:41 ` Larry Finger
@ 2021-01-10 12:15   ` Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 1/5] rtlwifi: rtl_pci: " Aditya Srivastava
                       ` (4 more replies)
  2021-01-13 17:11   ` [PATCH] drivers: net: wireless: rtlwifi: " Aditya
  1 sibling, 5 replies; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-10 12:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

This patch series fixes the bool comparison in conditional expressions
for all the drivers in rtlwifi.

There are certain conditional expressions in rtlwifi drivers, where a
boolean variable is compared with true/false, in forms such as
(foo == true) or (false != bar), which does not comply with checkpatch.pl
(CHECK: BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c,
"if (mac->act_scanning == true)" can be replaced with
"if (mac->act_scanning)"

Fix all such expressions with the bool variables appropriately for all
the drivers in rtlwifi

* The changes made are compile tested.
* The patches apply perfectly on next-20210108

Aditya Srivastava (5):
  rtlwifi: rtl_pci: fix bool comparison in expressions
  rtlwifi: rtl8192c-common: fix bool comparison in expressions
  rtlwifi: rtl8188ee: fix bool comparison in expressions
  rtlwifi: rtl8192se: fix bool comparison in expressions
  rtlwifi: rtl8821ae: fix bool comparison in expressions

 drivers/net/wireless/realtek/rtlwifi/ps.c                 | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c       | 8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c       | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c       | 4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c      | 8 ++++----
 6 files changed, 16 insertions(+), 16 deletions(-)

-- 
2.17.1


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

* [PATCH 1/5] rtlwifi: rtl_pci: fix bool comparison in expressions
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
@ 2021-01-10 12:15     ` Aditya Srivastava
  2021-01-25 14:22       ` Kalle Valo
  2021-01-10 12:15     ` [PATCH 2/5] rtlwifi: rtl8192c-common: " Aditya Srivastava
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-10 12:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

There are certain conditional expressions in rtl_pci, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g., in drivers/net/wireless/realtek/rtlwifi/ps.c,
"if (find_p2p_ie == true)" can be replaced with "if (find_p2p_ie)"

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index f99882255d48..629c03271bde 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -798,9 +798,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
 		ie += 3 + noa_len;
 	}
 
-	if (find_p2p_ie == true) {
+	if (find_p2p_ie) {
 		if ((p2pinfo->p2p_ps_mode > P2P_PS_NONE) &&
-		    (find_p2p_ps_ie == false))
+		    (!find_p2p_ps_ie))
 			rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
 	}
 }
-- 
2.17.1


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

* [PATCH 2/5] rtlwifi: rtl8192c-common: fix bool comparison in expressions
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 1/5] rtlwifi: rtl_pci: " Aditya Srivastava
@ 2021-01-10 12:15     ` Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 3/5] rtlwifi: rtl8188ee: " Aditya Srivastava
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-10 12:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

There are certain conditional expressions in rtl8192c-common, where a
boolean variable is compared with true/false, in forms such as
(foo == true) or (false != bar), which does not comply with checkpatch.pl
(CHECK: BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c,
"else if (initialized == false) {" can be replaced with
"else if (!initialized) {"

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c
index 265a1a336304..0b6a15c2e5cc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c
@@ -380,7 +380,7 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw)
 		initialized = false;
 		dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
 		return;
-	} else if (initialized == false) {
+	} else if (!initialized) {
 		initialized = true;
 		dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_0;
 		dm_digtable->cur_igvalue = 0x20;
@@ -509,7 +509,7 @@ static void rtl92c_dm_dig(struct ieee80211_hw *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 
-	if (rtlpriv->dm.dm_initialgain_enable == false)
+	if (!rtlpriv->dm.dm_initialgain_enable)
 		return;
 	if (!(rtlpriv->dm.dm_flag & DYNAMIC_FUNC_DIG))
 		return;
-- 
2.17.1


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

* [PATCH 3/5] rtlwifi: rtl8188ee: fix bool comparison in expressions
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 1/5] rtlwifi: rtl_pci: " Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 2/5] rtlwifi: rtl8192c-common: " Aditya Srivastava
@ 2021-01-10 12:15     ` Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 4/5] rtlwifi: rtl8192se: " Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 5/5] rtlwifi: rtl8821ae: " Aditya Srivastava
  4 siblings, 0 replies; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-10 12:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

There are certain conditional expressions in rtl8188ee, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c,
"if (mac->act_scanning == true)" can be replaced with
"if (mac->act_scanning)"

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c | 8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
index d10c14c694da..6f61d6a10627 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
@@ -474,11 +474,11 @@ static void rtl88e_dm_dig(struct ieee80211_hw *hw)
 	u8 dm_dig_max, dm_dig_min;
 	u8 current_igi = dm_dig->cur_igvalue;
 
-	if (rtlpriv->dm.dm_initialgain_enable == false)
+	if (!rtlpriv->dm.dm_initialgain_enable)
 		return;
-	if (dm_dig->dig_enable_flag == false)
+	if (!dm_dig->dig_enable_flag)
 		return;
-	if (mac->act_scanning == true)
+	if (mac->act_scanning)
 		return;
 
 	if (mac->link_state >= MAC80211_LINKED)
@@ -1637,7 +1637,7 @@ static void rtl88e_dm_fast_ant_training(struct ieee80211_hw *hw)
 			}
 		}
 
-		if (bpkt_filter_match == false) {
+		if (!bpkt_filter_match) {
 			rtl_set_bbreg(hw, DM_REG_TXAGC_A_1_MCS32_11N,
 				      BIT(16), 0);
 			rtl_set_bbreg(hw, DM_REG_IGI_A_11N, BIT(7), 0);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index bd9160b166c5..861cc663ca93 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -1269,12 +1269,12 @@ void rtl88ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
 	if (rtlpriv->psc.rfpwr_state != ERFON)
 		return;
 
-	if (check_bssid == true) {
+	if (check_bssid) {
 		reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
 		rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
 					      (u8 *)(&reg_rcr));
 		_rtl88ee_set_bcn_ctrl_reg(hw, 0, BIT(4));
-	} else if (check_bssid == false) {
+	} else if (!check_bssid) {
 		reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN));
 		_rtl88ee_set_bcn_ctrl_reg(hw, BIT(4), 0);
 		rtlpriv->cfg->ops->set_hw_reg(hw,
-- 
2.17.1


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

* [PATCH 4/5] rtlwifi: rtl8192se: fix bool comparison in expressions
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
                       ` (2 preceding siblings ...)
  2021-01-10 12:15     ` [PATCH 3/5] rtlwifi: rtl8188ee: " Aditya Srivastava
@ 2021-01-10 12:15     ` Aditya Srivastava
  2021-01-10 12:15     ` [PATCH 5/5] rtlwifi: rtl8821ae: " Aditya Srivastava
  4 siblings, 0 replies; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-10 12:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

There are certain conditional expressions in rtl8192se, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
index 47fabce5c235..73a5d8a068fc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
@@ -458,7 +458,7 @@ static u8 _rtl92se_halset_sysclk(struct ieee80211_hw *hw, u8 data)
 	tmpvalue = rtl_read_byte(rtlpriv, SYS_CLKR + 1);
 	bresult = ((tmpvalue & BIT(7)) == (data & BIT(7)));
 
-	if ((data & (BIT(6) | BIT(7))) == false) {
+	if (!(data & (BIT(6) | BIT(7)))) {
 		waitcount = 100;
 		tmpvalue = 0;
 
@@ -1268,7 +1268,7 @@ static u8 _rtl92s_set_sysclk(struct ieee80211_hw *hw, u8 data)
 	tmp = rtl_read_byte(rtlpriv, SYS_CLKR + 1);
 	result = ((tmp & BIT(7)) == (data & BIT(7)));
 
-	if ((data & (BIT(6) | BIT(7))) == false) {
+	if (!(data & (BIT(6) | BIT(7)))) {
 		waitcnt = 100;
 		tmp = 0;
 
-- 
2.17.1


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

* [PATCH 5/5] rtlwifi: rtl8821ae: fix bool comparison in expressions
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
                       ` (3 preceding siblings ...)
  2021-01-10 12:15     ` [PATCH 4/5] rtlwifi: rtl8192se: " Aditya Srivastava
@ 2021-01-10 12:15     ` Aditya Srivastava
  4 siblings, 0 replies; 10+ messages in thread
From: Aditya Srivastava @ 2021-01-10 12:15 UTC (permalink / raw)
  To: linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

There are certain conditional expressions in rtl8821ae, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c,
"if (rtlefuse->autoload_failflag == false)" can be replaced with
"if (!rtlefuse->autoload_failflag)"

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 372d6f8caf06..e214b9062cc1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -1812,7 +1812,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 		return false;
 	}
 	_rtl8821ae_phy_init_tx_power_by_rate(hw);
-	if (rtlefuse->autoload_failflag == false) {
+	if (!rtlefuse->autoload_failflag) {
 		rtstatus = _rtl8821ae_phy_config_bb_with_pgheaderfile(hw,
 						    BASEBAND_CONFIG_PHY_REG);
 	}
@@ -3980,7 +3980,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path)
 				}
 			}
 
-			if (tx0iqkok == false)
+			if (!tx0iqkok)
 				break;				/* TXK fail, Don't do RXK */
 
 			if (vdf_enable == 1) {
@@ -4090,7 +4090,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path)
 						}
 					}
 
-					if (tx0iqkok == false) {   /* If RX mode TXK fail, then take TXK Result */
+					if (!tx0iqkok) {   /* If RX mode TXK fail, then take TXK Result */
 						tx_x0_rxk[cal] = tx_x0[cal];
 						tx_y0_rxk[cal] = tx_y0[cal];
 						tx0iqkok = true;
@@ -4249,7 +4249,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path)
 					}
 				}
 
-				if (tx0iqkok == false) {   /* If RX mode TXK fail, then take TXK Result */
+				if (!tx0iqkok) {   /* If RX mode TXK fail, then take TXK Result */
 					tx_x0_rxk[cal] = tx_x0[cal];
 					tx_y0_rxk[cal] = tx_y0[cal];
 					tx0iqkok = true;
-- 
2.17.1


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

* Re: [PATCH] drivers: net: wireless: rtlwifi: fix bool comparison in expressions
  2021-01-08 19:41 ` Larry Finger
  2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
@ 2021-01-13 17:11   ` Aditya
  1 sibling, 0 replies; 10+ messages in thread
From: Aditya @ 2021-01-13 17:11 UTC (permalink / raw)
  To: Larry Finger, linux-wireless
  Cc: pkshih, kvalo, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn

On 9/1/21 1:11 am, Larry Finger wrote:
> On 1/8/21 9:32 AM, Aditya Srivastava wrote:
>> There are certain conditional expressions in rtlwifi, where a boolean
>> variable is compared with true/false, in forms such as (foo == true) or
>> (false != bar), which does not comply with checkpatch.pl (CHECK:
>> BOOL_COMPARISON), according to which boolean variables should be
>> themselves used in the condition, rather than comparing with true/false
>>
>> E.g., in drivers/net/wireless/realtek/rtlwifi/ps.c,
>> "if (find_p2p_ie == true)" can be replaced with "if (find_p2p_ie)"
>>
>> Replace all such expressions with the bool variables appropriately
>>
>> Signed-off-by: Aditya Srivastava<yashsri421@gmail.com>
>> ---
>> - The changes made are compile tested
>> - Applies perfecly on next-20210108
>>
>>   drivers/net/wireless/realtek/rtlwifi/ps.c                 | 4 ++--
>>   drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c       | 8
>> ++++----
>>   drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c       | 4 ++--
>>   drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c | 4 ++--
>>   drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c       | 4 ++--
>>   drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c      | 8
>> ++++----
>>   6 files changed, 16 insertions(+), 16 deletions(-)
> 
> As has been stated several times, this form of the subject is
> incorrect. It should be: "rtlwifi: <driver_name>: <subject>
> 
> I would prefer that there be separate patches for each driver, not
> that the changes be lumped into a single patch as was done here. Such
> organization makes it a lot easier to find the patches for a given
> driver in case something goes wrong.Note: The driver for ps is
> rtl_pci, and that for rtl8192c is rtl8192c-common. The other driver
> names match their directory.
> 
> Larry
> 

Hi Larry!
I sent the modified patches as patch series separately.
I probably missed CCing you :/

The patch series can be found at:
https://lore.kernel.org/linux-wireless/20210110121525.2407-1-yashsri421@gmail.com/#t

Please review :)

Thanks
Aditya


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

* Re: [PATCH 1/5] rtlwifi: rtl_pci: fix bool comparison in expressions
  2021-01-10 12:15     ` [PATCH 1/5] rtlwifi: rtl_pci: " Aditya Srivastava
@ 2021-01-25 14:22       ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2021-01-25 14:22 UTC (permalink / raw)
  To: Aditya Srivastava
  Cc: linux-wireless, pkshih, davem, kuba, netdev, linux-kernel,
	linux-kernel-mentees, lukas.bulwahn, yashsri421

Aditya Srivastava <yashsri421@gmail.com> wrote:

> There are certain conditional expressions in rtl_pci, where a boolean
> variable is compared with true/false, in forms such as (foo == true) or
> (false != bar), which does not comply with checkpatch.pl (CHECK:
> BOOL_COMPARISON), according to which boolean variables should be
> themselves used in the condition, rather than comparing with true/false
> 
> E.g., in drivers/net/wireless/realtek/rtlwifi/ps.c,
> "if (find_p2p_ie == true)" can be replaced with "if (find_p2p_ie)"
> 
> Replace all such expressions with the bool variables appropriately
> 
> Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>

5 patches applied to wireless-drivers-next.git, thanks.

d8cbaa3de403 rtlwifi: rtl_pci: fix bool comparison in expressions
f7c76283fc5f rtlwifi: rtl8192c-common: fix bool comparison in expressions
64338f0dfd6a rtlwifi: rtl8188ee: fix bool comparison in expressions
33ae4623d544 rtlwifi: rtl8192se: fix bool comparison in expressions
9264cabc1204 rtlwifi: rtl8821ae: fix bool comparison in expressions

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210110121525.2407-2-yashsri421@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2021-01-26  6:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 15:32 [PATCH] drivers: net: wireless: rtlwifi: fix bool comparison in expressions Aditya Srivastava
2021-01-08 19:41 ` Larry Finger
2021-01-10 12:15   ` [PATCH 0/5] " Aditya Srivastava
2021-01-10 12:15     ` [PATCH 1/5] rtlwifi: rtl_pci: " Aditya Srivastava
2021-01-25 14:22       ` Kalle Valo
2021-01-10 12:15     ` [PATCH 2/5] rtlwifi: rtl8192c-common: " Aditya Srivastava
2021-01-10 12:15     ` [PATCH 3/5] rtlwifi: rtl8188ee: " Aditya Srivastava
2021-01-10 12:15     ` [PATCH 4/5] rtlwifi: rtl8192se: " Aditya Srivastava
2021-01-10 12:15     ` [PATCH 5/5] rtlwifi: rtl8821ae: " Aditya Srivastava
2021-01-13 17:11   ` [PATCH] drivers: net: wireless: rtlwifi: " Aditya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).