wifi: rtlwifi: rtl8192c: using calculate_bit_shift()
[ Upstream commit 1dedc3a6699d827d345019e921b8d8f37f694333 ] Using calculate_bit_shift() to replace _rtl92c_phy_calculate_bit_shift(). And fix the undefined bitwise shift behavior problem. Fixes: 4295cd254af3 ("rtlwifi: Move common parts of rtl8192ce/phy.c") Signed-off-by: Su Hui <suhui@nfschina.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20231219065739.1895666-5-suhui@nfschina.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
69819aa824
commit
db5832c86b
2 changed files with 2 additions and 11 deletions
|
@ -17,7 +17,7 @@ u32 rtl92c_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
|
|||
rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n",
|
||||
regaddr, bitmask);
|
||||
originalvalue = rtl_read_dword(rtlpriv, regaddr);
|
||||
bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
returnvalue = (originalvalue & bitmask) >> bitshift;
|
||||
|
||||
rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
|
||||
|
@ -40,7 +40,7 @@ void rtl92c_phy_set_bb_reg(struct ieee80211_hw *hw,
|
|||
|
||||
if (bitmask != MASKDWORD) {
|
||||
originalvalue = rtl_read_dword(rtlpriv, regaddr);
|
||||
bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
data = ((originalvalue & (~bitmask)) | (data << bitshift));
|
||||
}
|
||||
|
||||
|
@ -143,14 +143,6 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
|
|||
}
|
||||
EXPORT_SYMBOL(_rtl92c_phy_rf_serial_write);
|
||||
|
||||
u32 _rtl92c_phy_calculate_bit_shift(u32 bitmask)
|
||||
{
|
||||
u32 i = ffs(bitmask);
|
||||
|
||||
return i ? i - 1 : 32;
|
||||
}
|
||||
EXPORT_SYMBOL(_rtl92c_phy_calculate_bit_shift);
|
||||
|
||||
static void _rtl92c_phy_bb_config_1t(struct ieee80211_hw *hw)
|
||||
{
|
||||
rtl_set_bbreg(hw, RFPGA0_TXINFO, 0x3, 0x2);
|
||||
|
|
|
@ -196,7 +196,6 @@ bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw,
|
|||
void rtl92ce_phy_set_rf_on(struct ieee80211_hw *hw);
|
||||
void rtl92c_phy_set_io(struct ieee80211_hw *hw);
|
||||
void rtl92c_bb_block_on(struct ieee80211_hw *hw);
|
||||
u32 _rtl92c_phy_calculate_bit_shift(u32 bitmask);
|
||||
long _rtl92c_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
|
||||
enum wireless_mode wirelessmode,
|
||||
u8 txpwridx);
|
||||
|
|
Loading…
Reference in a new issue