mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 23:20:32 -04:00
wifi: rtlwifi: rtl8723_common: using calculate_bit_shift()
Using calculate_bit_shift() to replace rtl8723_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.
Fixes: 0a168b48cd ("rtlwifi: rtl8723ae: rtl8723-common: Create new driver for common code")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-11-suhui@nfschina.com
This commit is contained in:
@@ -17,7 +17,7 @@ u32 rtl8723_phy_query_bb_reg(struct ieee80211_hw *hw,
|
||||
rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
|
||||
"regaddr(%#x), bitmask(%#x)\n", regaddr, bitmask);
|
||||
originalvalue = rtl_read_dword(rtlpriv, regaddr);
|
||||
bitshift = rtl8723_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
returnvalue = (originalvalue & bitmask) >> bitshift;
|
||||
|
||||
rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
|
||||
@@ -39,7 +39,7 @@ void rtl8723_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
|
||||
|
||||
if (bitmask != MASKDWORD) {
|
||||
originalvalue = rtl_read_dword(rtlpriv, regaddr);
|
||||
bitshift = rtl8723_phy_calculate_bit_shift(bitmask);
|
||||
bitshift = calculate_bit_shift(bitmask);
|
||||
data = ((originalvalue & (~bitmask)) | (data << bitshift));
|
||||
}
|
||||
|
||||
@@ -51,14 +51,6 @@ void rtl8723_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl8723_phy_set_bb_reg);
|
||||
|
||||
u32 rtl8723_phy_calculate_bit_shift(u32 bitmask)
|
||||
{
|
||||
u32 i = ffs(bitmask);
|
||||
|
||||
return i ? i - 1 : 32;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl8723_phy_calculate_bit_shift);
|
||||
|
||||
u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
|
||||
enum radio_path rfpath, u32 offset)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ u32 rtl8723_phy_query_bb_reg(struct ieee80211_hw *hw,
|
||||
u32 regaddr, u32 bitmask);
|
||||
void rtl8723_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
|
||||
u32 bitmask, u32 data);
|
||||
u32 rtl8723_phy_calculate_bit_shift(u32 bitmask);
|
||||
u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
|
||||
enum radio_path rfpath, u32 offset);
|
||||
void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
|
||||
|
||||
Reference in New Issue
Block a user