wifi: rtlwifi: add calculate_bit_shift()
authorSu Hui <suhui@nfschina.com>
Tue, 19 Dec 2023 06:57:29 +0000 (14:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:28 +0000 (15:35 -0800)
commit1b2260bc3403da50b4e1ac2fada81d6717db68c8
treeabdbd486e90b3916c7ad2cff5d43bd148bd3f857
parent3bc29c780aca9f3d149e0f51e069fd9ff3b66dd9
wifi: rtlwifi: add calculate_bit_shift()

[ Upstream commit 52221dfddbbfb5b4e029bb2efe9bb7da33ec1e46 ]

There are many same functions like _rtl88e_phy_calculate_bit_shift(),
_rtl92c_phy_calculate_bit_shift() and so on. And these functions can
cause undefined bitwise shift behavior. Add calculate_bit_shift() to
replace them and fix undefined behavior in subsequent patches.

Signed-off-by: Su Hui <suhui@nfschina.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-2-suhui@nfschina.com
Stable-dep-of: 969bc926f04b ("wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtlwifi/wifi.h