Skip to contentSkip to conversation

wireless: realtek: Simplify bool comparison

PATCH In review YANG LI 2 participants 2 messages Jan 12, 2021

Subsystems (3)
lore
Share & tools
lore

YANG LI

author
#0 lore raw

PATCH 1/1 wireless: realtek: Simplify bool comparison

Fix the following coccicheck warning:
./drivers/net/wireless/realtek/rtlwifi/ps.c:803:7-21: WARNING:
Comparison to bool

---
 drivers/net/wireless/realtek/rtlwifi/ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/ps.c +2 -2
index f9988225..629c032 100644
@@ -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);
 	}
 }
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 25 lines · YANG LI

Fix the following coccicheck warning:
./drivers/net/wireless/realtek/rtlwifi/ps.c:803:7-21: WARNING:
Comparison to bool

---
 drivers/net/wireless/realtek/rtlwifi/ps.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/ps.c +0 -0
index f9988225..629c032 100644
@@ -798,9 +798,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void
 *data,
  		ie += 3 + noa_len;
  	}

drivers/net/wireless/realtek/rtlwifi/ps.c +1 -1
-	if (find_p2p_ie == true) {
+	if (find_p2p_ie) {

  if ((p2pinfo->p2p_ps_mode > P2P_PS_NONE) &&

drivers/net/wireless/realtek/rtlwifi/ps.c +1 -1
-		    (find_p2p_ps_ie == false))
+		    (!find_p2p_ps_ie))
Quoted 3 lines

  rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE); }
 }

The subject prefix should be "rtlwifi:".
And, I think it's ok to merge this patch with another patch ("rtlwifi: rtl8821ae: style: Simplify bool comparison"). Because both of them are trivial fixes and belong to rtlwifi.

---
Ping-Ke