Blame SOURCES/0015-rtw89-remove-unnecessary-conditional-operators.patch

56e3f4
From 32bb5a6874a7ee13bc39d76e9629b75accfd0afe Mon Sep 17 00:00:00 2001
56e3f4
From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= <ihuguet@redhat.com>
56e3f4
Date: Fri, 21 Jan 2022 08:49:03 +0100
56e3f4
Subject: [PATCH 15/36] rtw89: remove unnecessary conditional operators
56e3f4
MIME-Version: 1.0
56e3f4
Content-Type: text/plain; charset=UTF-8
56e3f4
Content-Transfer-Encoding: 8bit
56e3f4
56e3f4
Bugzilla: http://bugzilla.redhat.com/2033291
56e3f4
56e3f4
commit 1646ce8f83b953a675cb99e7b6708d8121b5fecf
56e3f4
Author: Ye Guojin <ye.guojin@zte.com.cn>
56e3f4
Date:   Thu Nov 4 06:11:19 2021 +0000
56e3f4
56e3f4
    rtw89: remove unnecessary conditional operators
56e3f4
56e3f4
    The conditional operator is unnecessary while assigning values to the
56e3f4
    bool variables.
56e3f4
56e3f4
    Reported-by: Zeal Robot <zealci@zte.com.cn>
56e3f4
    Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
56e3f4
    Acked-by: Ping-Ke Shih <pkshih@realtek.com>
56e3f4
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
56e3f4
    Link: https://lore.kernel.org/r/20211104061119.1685-1-ye.guojin@zte.com.cn
56e3f4
56e3f4
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
56e3f4
---
56e3f4
 drivers/net/wireless/realtek/rtw89/debug.c    | 2 +-
56e3f4
 drivers/net/wireless/realtek/rtw89/mac.c      | 2 +-
56e3f4
 drivers/net/wireless/realtek/rtw89/phy.c      | 2 +-
56e3f4
 drivers/net/wireless/realtek/rtw89/rtw8852a.c | 4 ++--
56e3f4
 4 files changed, 5 insertions(+), 5 deletions(-)
56e3f4
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
56e3f4
index 29eb188c888c..75f10627585b 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/debug.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/debug.c
56e3f4
@@ -814,7 +814,7 @@ rtw89_debug_priv_mac_dbg_port_dump_select(struct file *filp,
56e3f4
 		return -EINVAL;
56e3f4
 	}
56e3f4
 
56e3f4
-	enable = set == 0 ? false : true;
56e3f4
+	enable = set != 0;
56e3f4
 	switch (sel) {
56e3f4
 	case 0:
56e3f4
 		debugfs_priv->dbgpkg_en.ss_dbg = enable;
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
56e3f4
index afcd07ab1de7..944c23293cb9 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/mac.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
56e3f4
@@ -3695,7 +3695,7 @@ void _rtw89_mac_bf_monitor_track(struct rtw89_dev *rtwdev)
56e3f4
 {
56e3f4
 	struct rtw89_traffic_stats *stats = &rtwdev->stats;
56e3f4
 	struct rtw89_vif *rtwvif;
56e3f4
-	bool en = stats->tx_tfc_lv > stats->rx_tfc_lv ? false : true;
56e3f4
+	bool en = stats->tx_tfc_lv <= stats->rx_tfc_lv;
56e3f4
 	bool old = test_bit(RTW89_FLAG_BFEE_EN, rtwdev->flags);
56e3f4
 
56e3f4
 	if (en == old)
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
56e3f4
index 0620ef02e275..abb4cdcd03e7 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/phy.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
56e3f4
@@ -1779,7 +1779,7 @@ static void rtw89_phy_cfo_dm(struct rtw89_dev *rtwdev)
56e3f4
 	}
56e3f4
 	rtw89_phy_cfo_crystal_cap_adjust(rtwdev, new_cfo);
56e3f4
 	cfo->cfo_avg_pre = new_cfo;
56e3f4
-	x_cap_update =  cfo->crystal_cap == pre_x_cap ? false : true;
56e3f4
+	x_cap_update =  cfo->crystal_cap != pre_x_cap;
56e3f4
 	rtw89_debug(rtwdev, RTW89_DBG_CFO, "Xcap_up=%d\n", x_cap_update);
56e3f4
 	rtw89_debug(rtwdev, RTW89_DBG_CFO, "Xcap: D:%x C:%x->%x, ofst=%d\n",
56e3f4
 		    cfo->def_x_cap, pre_x_cap, cfo->crystal_cap,
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a.c b/drivers/net/wireless/realtek/rtw89/rtw8852a.c
56e3f4
index 5c6ffca3a324..9e25e53f6c4a 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/rtw8852a.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852a.c
56e3f4
@@ -1053,10 +1053,10 @@ static void rtw8852a_set_channel_bb(struct rtw89_dev *rtwdev,
56e3f4
 				    struct rtw89_channel_params *param,
56e3f4
 				    enum rtw89_phy_idx phy_idx)
56e3f4
 {
56e3f4
-	bool cck_en = param->center_chan > 14 ? false : true;
56e3f4
+	bool cck_en = param->center_chan <= 14;
56e3f4
 	u8 pri_ch_idx = param->pri_ch_idx;
56e3f4
 
56e3f4
-	if (param->center_chan <= 14)
56e3f4
+	if (cck_en)
56e3f4
 		rtw8852a_ctrl_sco_cck(rtwdev, param->center_chan,
56e3f4
 				      param->primary_chan, param->bandwidth);
56e3f4
 
56e3f4
-- 
56e3f4
2.13.6
56e3f4