mirror of
https://github.com/torvalds/linux
synced 2024-10-06 19:34:19 +00:00
wifi: rtlwifi: use convenient list_count_nodes()
Simplify 'rtl92ee_dm_common_info_self_update()', 'rtl8723be_dm_common_info_self_update()', and 'rtl8821ae_dm_common_info_self_update()' by using 'list_count_nodes()'. Compile tested only. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231011045227.7989-1-dmantipov@yandex.ru
This commit is contained in:
parent
d9756ce618
commit
0c27d27258
|
@ -936,8 +936,7 @@ void rtl92ee_dm_init(struct ieee80211_hw *hw)
|
|||
static void rtl92ee_dm_common_info_self_update(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_sta_info *drv_priv;
|
||||
u8 cnt = 0;
|
||||
u8 cnt;
|
||||
|
||||
rtlpriv->dm.one_entry_only = false;
|
||||
|
||||
|
@ -951,9 +950,7 @@ static void rtl92ee_dm_common_info_self_update(struct ieee80211_hw *hw)
|
|||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_ADHOC ||
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
spin_lock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
list_for_each_entry(drv_priv, &rtlpriv->entry_list, list) {
|
||||
cnt++;
|
||||
}
|
||||
cnt = list_count_nodes(&rtlpriv->entry_list);
|
||||
spin_unlock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
|
||||
if (cnt == 1)
|
||||
|
|
|
@ -1210,8 +1210,7 @@ static void rtl8723be_dm_dynamic_atc_switch(struct ieee80211_hw *hw)
|
|||
static void rtl8723be_dm_common_info_self_update(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
u8 cnt = 0;
|
||||
struct rtl_sta_info *drv_priv;
|
||||
u8 cnt;
|
||||
|
||||
rtlpriv->dm.one_entry_only = false;
|
||||
|
||||
|
@ -1225,9 +1224,7 @@ static void rtl8723be_dm_common_info_self_update(struct ieee80211_hw *hw)
|
|||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_ADHOC ||
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
spin_lock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
list_for_each_entry(drv_priv, &rtlpriv->entry_list, list) {
|
||||
cnt++;
|
||||
}
|
||||
cnt = list_count_nodes(&rtlpriv->entry_list);
|
||||
spin_unlock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
|
||||
if (cnt == 1)
|
||||
|
|
|
@ -827,8 +827,7 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw)
|
|||
static void rtl8821ae_dm_common_info_self_update(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
u8 cnt = 0;
|
||||
struct rtl_sta_info *drv_priv;
|
||||
u8 cnt;
|
||||
|
||||
rtlpriv->dm.tx_rate = 0xff;
|
||||
|
||||
|
@ -844,8 +843,7 @@ static void rtl8821ae_dm_common_info_self_update(struct ieee80211_hw *hw)
|
|||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_ADHOC ||
|
||||
rtlpriv->mac80211.opmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
spin_lock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
list_for_each_entry(drv_priv, &rtlpriv->entry_list, list)
|
||||
cnt++;
|
||||
cnt = list_count_nodes(&rtlpriv->entry_list);
|
||||
spin_unlock_bh(&rtlpriv->locks.entry_list_lock);
|
||||
|
||||
if (cnt == 1)
|
||||
|
|
Loading…
Reference in a new issue