wifi: rtlwifi: rtl8192cu: using calculate_bit_shift()
Using calculate_bit_shift() to replace _rtl92c_phy_calculate_bit_shift().
And fix an undefined bitwise shift behavior problem.
Fixes: f0a39ae738
("rtlwifi: rtl8192cu: Add routine phy")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-6-suhui@nfschina.com
This commit is contained in:
parent
1dedc3a669
commit
f4088c8fcb
@ -32,7 +32,7 @@ u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
|
||||
original_value = _rtl92c_phy_fw_rf_serial_read(hw,
|
||||
rfpath, regaddr);
|
||||
}
|
||||
bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
readback_value = (original_value & bitmask) >> bitshift;
|
||||
rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
|
||||
"regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
|
||||
@ -56,7 +56,7 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
|
||||
original_value = _rtl92c_phy_rf_serial_read(hw,
|
||||
rfpath,
|
||||
regaddr);
|
||||
bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
data =
|
||||
((original_value & (~bitmask)) |
|
||||
(data << bitshift));
|
||||
@ -67,7 +67,7 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
|
||||
original_value = _rtl92c_phy_fw_rf_serial_read(hw,
|
||||
rfpath,
|
||||
regaddr);
|
||||
bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
data =
|
||||
((original_value & (~bitmask)) |
|
||||
(data << bitshift));
|
||||
|
Loading…
Reference in New Issue
Block a user