Commit 1646ce8f authored by Ye Guojin's avatar Ye Guojin Committed by Kalle Valo

rtw89: remove unnecessary conditional operators

The conditional operator is unnecessary while assigning values to the
bool variables.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarYe Guojin <ye.guojin@zte.com.cn>
Acked-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211104061119.1685-1-ye.guojin@zte.com.cn
parent 08e16498
...@@ -814,7 +814,7 @@ rtw89_debug_priv_mac_dbg_port_dump_select(struct file *filp, ...@@ -814,7 +814,7 @@ rtw89_debug_priv_mac_dbg_port_dump_select(struct file *filp,
return -EINVAL; return -EINVAL;
} }
enable = set == 0 ? false : true; enable = set != 0;
switch (sel) { switch (sel) {
case 0: case 0:
debugfs_priv->dbgpkg_en.ss_dbg = enable; debugfs_priv->dbgpkg_en.ss_dbg = enable;
......
...@@ -3695,7 +3695,7 @@ void _rtw89_mac_bf_monitor_track(struct rtw89_dev *rtwdev) ...@@ -3695,7 +3695,7 @@ void _rtw89_mac_bf_monitor_track(struct rtw89_dev *rtwdev)
{ {
struct rtw89_traffic_stats *stats = &rtwdev->stats; struct rtw89_traffic_stats *stats = &rtwdev->stats;
struct rtw89_vif *rtwvif; struct rtw89_vif *rtwvif;
bool en = stats->tx_tfc_lv > stats->rx_tfc_lv ? false : true; bool en = stats->tx_tfc_lv <= stats->rx_tfc_lv;
bool old = test_bit(RTW89_FLAG_BFEE_EN, rtwdev->flags); bool old = test_bit(RTW89_FLAG_BFEE_EN, rtwdev->flags);
if (en == old) if (en == old)
......
...@@ -1779,7 +1779,7 @@ static void rtw89_phy_cfo_dm(struct rtw89_dev *rtwdev) ...@@ -1779,7 +1779,7 @@ static void rtw89_phy_cfo_dm(struct rtw89_dev *rtwdev)
} }
rtw89_phy_cfo_crystal_cap_adjust(rtwdev, new_cfo); rtw89_phy_cfo_crystal_cap_adjust(rtwdev, new_cfo);
cfo->cfo_avg_pre = new_cfo; cfo->cfo_avg_pre = new_cfo;
x_cap_update = cfo->crystal_cap == pre_x_cap ? false : true; x_cap_update = cfo->crystal_cap != pre_x_cap;
rtw89_debug(rtwdev, RTW89_DBG_CFO, "Xcap_up=%d\n", x_cap_update); rtw89_debug(rtwdev, RTW89_DBG_CFO, "Xcap_up=%d\n", x_cap_update);
rtw89_debug(rtwdev, RTW89_DBG_CFO, "Xcap: D:%x C:%x->%x, ofst=%d\n", rtw89_debug(rtwdev, RTW89_DBG_CFO, "Xcap: D:%x C:%x->%x, ofst=%d\n",
cfo->def_x_cap, pre_x_cap, cfo->crystal_cap, cfo->def_x_cap, pre_x_cap, cfo->crystal_cap,
......
...@@ -1053,10 +1053,10 @@ static void rtw8852a_set_channel_bb(struct rtw89_dev *rtwdev, ...@@ -1053,10 +1053,10 @@ static void rtw8852a_set_channel_bb(struct rtw89_dev *rtwdev,
struct rtw89_channel_params *param, struct rtw89_channel_params *param,
enum rtw89_phy_idx phy_idx) enum rtw89_phy_idx phy_idx)
{ {
bool cck_en = param->center_chan > 14 ? false : true; bool cck_en = param->center_chan <= 14;
u8 pri_ch_idx = param->pri_ch_idx; u8 pri_ch_idx = param->pri_ch_idx;
if (param->center_chan <= 14) if (cck_en)
rtw8852a_ctrl_sco_cck(rtwdev, param->center_chan, rtw8852a_ctrl_sco_cck(rtwdev, param->center_chan,
param->primary_chan, param->bandwidth); param->primary_chan, param->bandwidth);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment