From d8f36e803a9c40e5461ec651b114a3d42d5c777d Mon Sep 17 00:00:00 2001 From: "Frank A. Cancio Bello" Date: Tue, 17 Oct 2017 23:35:51 -0400 Subject: [PATCH] staging: rtlwifi: rtl8822be: Remove useless parentheses Remove unnecessary parentheses to comply with preferred coding style for the linux kernel and avoid the following checkpatch's message: 'CHECK: Unnecessary parentheses around'. Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtlwifi/rtl8822be/fw.c | 4 ++-- drivers/staging/rtlwifi/rtl8822be/led.c | 2 +- drivers/staging/rtlwifi/rtl8822be/phy.c | 10 +++++----- drivers/staging/rtlwifi/rtl8822be/trx.c | 18 +++++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtlwifi/rtl8822be/fw.c b/drivers/staging/rtlwifi/rtl8822be/fw.c index 02f5004a9a0c..fa62983fc267 100644 --- a/drivers/staging/rtlwifi/rtl8822be/fw.c +++ b/drivers/staging/rtlwifi/rtl8822be/fw.c @@ -330,7 +330,7 @@ void rtl8822be_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode) byte5 = btc_ops->btc_get_lps_val(rtlpriv); power_state = btc_ops->btc_get_rpwm_val(rtlpriv); - if ((rlbm == 2) && (byte5 & BIT(4))) { + if (rlbm == 2 && (byte5 & BIT(4))) { /* Keep awake interval to 1 to prevent from * decreasing coex performance */ @@ -835,7 +835,7 @@ void rtl8822be_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state) rtl_write_dword(rtlpriv, 0x5EC, p2pinfo->noa_count_type[i]); } - if ((p2pinfo->opp_ps == 1) || (p2pinfo->noa_num > 0)) { + if (p2pinfo->opp_ps == 1 || p2pinfo->noa_num > 0) { /* rst p2p circuit */ rtl_write_byte(rtlpriv, REG_DUAL_TSF_RST_8822B, BIT(4)); p2p_ps_offload->offload_en = 1; diff --git a/drivers/staging/rtlwifi/rtl8822be/led.c b/drivers/staging/rtlwifi/rtl8822be/led.c index f4b5af8ab116..0054c892dce6 100644 --- a/drivers/staging/rtlwifi/rtl8822be/led.c +++ b/drivers/staging/rtlwifi/rtl8822be/led.c @@ -114,7 +114,7 @@ void rtl8822be_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); - if ((ppsc->rfoff_reason > RF_CHANGE_BY_PS) && + if (ppsc->rfoff_reason > RF_CHANGE_BY_PS && (ledaction == LED_CTL_TX || ledaction == LED_CTL_RX || ledaction == LED_CTL_SITE_SURVEY || ledaction == LED_CTL_LINK || ledaction == LED_CTL_NO_LINK || diff --git a/drivers/staging/rtlwifi/rtl8822be/phy.c b/drivers/staging/rtlwifi/rtl8822be/phy.c index 589ef1584a8f..aacaca6b968e 100644 --- a/drivers/staging/rtlwifi/rtl8822be/phy.c +++ b/drivers/staging/rtlwifi/rtl8822be/phy.c @@ -1610,9 +1610,9 @@ u8 rtl8822be_get_txpower_index(struct ieee80211_hw *hw, u8 path, u8 rate, char limit; char powerdiff_byrate = 0; - if (((rtlhal->current_bandtype == BAND_ON_2_4G) && + if ((rtlhal->current_bandtype == BAND_ON_2_4G && (channel > 14 || channel < 1)) || - ((rtlhal->current_bandtype == BAND_ON_5G) && (channel <= 14))) { + (rtlhal->current_bandtype == BAND_ON_5G && channel <= 14)) { index = 0; RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Illegal channel!!\n"); @@ -1913,8 +1913,8 @@ static u8 _rtl8822be_phy_get_pri_ch_id(struct rtl_priv *rtlpriv) if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_80) { /* primary channel is at lower subband of 80MHz & 40MHz */ - if ((mac->cur_40_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER) && - (mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER)) { + if (mac->cur_40_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER && + mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER) { pri_ch_idx = VHT_DATA_SC_20_LOWEST_OF_80MHZ; /* primary channel is at * lower subband of 80MHz & upper subband of 40MHz @@ -2142,7 +2142,7 @@ static bool _rtl8822be_phy_set_rf_power_state(struct ieee80211_hw *hw, switch (rfpwr_state) { case ERFON: - if ((ppsc->rfpwr_state == ERFOFF) && + if (ppsc->rfpwr_state == ERFOFF && RT_IN_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC)) { bool rtstatus = false; u32 initialize_count = 0; diff --git a/drivers/staging/rtlwifi/rtl8822be/trx.c b/drivers/staging/rtlwifi/rtl8822be/trx.c index 54f65f35474b..87e15e419252 100644 --- a/drivers/staging/rtlwifi/rtl8822be/trx.c +++ b/drivers/staging/rtlwifi/rtl8822be/trx.c @@ -165,7 +165,7 @@ static bool rtl8822be_get_rxdesc_is_ht(struct ieee80211_hw *hw, u8 *pdesc) RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, "rx_rate=0x%02x.\n", rx_rate); - if ((rx_rate >= DESC_RATEMCS0) && (rx_rate <= DESC_RATEMCS15)) + if (rx_rate >= DESC_RATEMCS0 && rx_rate <= DESC_RATEMCS15) return true; else return false; @@ -193,8 +193,8 @@ static u8 rtl8822be_get_rx_vht_nss(struct ieee80211_hw *hw, u8 *pdesc) rx_rate = GET_RX_DESC_RX_RATE(pdesc); - if ((rx_rate >= DESC_RATEVHT1SS_MCS0) && - (rx_rate <= DESC_RATEVHT1SS_MCS9)) + if (rx_rate >= DESC_RATEVHT1SS_MCS0 && + rx_rate <= DESC_RATEVHT1SS_MCS9) vht_nss = 1; else if ((rx_rate >= DESC_RATEVHT2SS_MCS0) && (rx_rate <= DESC_RATEVHT2SS_MCS9)) @@ -510,8 +510,8 @@ static u8 rtl8822be_bw_mapping(struct ieee80211_hw *hw, else bw_setting_of_desc = 0; } else if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) { - if ((ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_20_40) || - (ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_80)) + if (ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_20_40 || + ptcb_desc->packet_bw == HT_CHANNEL_WIDTH_80) bw_setting_of_desc = 1; else bw_setting_of_desc = 0; @@ -546,10 +546,10 @@ static u8 rtl8822be_sc_mapping(struct ieee80211_hw *hw, "%s: Not Correct Primary40MHz Setting\n", __func__); } else { - if ((mac->cur_40_prime_sc == - HAL_PRIME_CHNL_OFFSET_LOWER) && - (mac->cur_80_prime_sc == - HAL_PRIME_CHNL_OFFSET_LOWER)) + if (mac->cur_40_prime_sc == + HAL_PRIME_CHNL_OFFSET_LOWER && + mac->cur_80_prime_sc == + HAL_PRIME_CHNL_OFFSET_LOWER) sc_setting_of_desc = VHT_DATA_SC_20_LOWEST_OF_80MHZ; else if ((mac->cur_40_prime_sc ==