> -----Original Message-----
> From: Dmitry Antipov <[email protected]>
> Sent: Tuesday, October 10, 2023 9:04 PM
> To: Ping-Ke Shih <[email protected]>
> Cc: Kalle Valo <[email protected]>; [email protected]; Dmitry Antipov <[email protected]>
> Subject: [PATCH] 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 <[email protected]>
> ---
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c | 5 +----
> drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c | 5 +----
> drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 4 +---
> 3 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c
> index 997ff115b9ab..efd22b75c05f 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c
> @@ -936,7 +936,6 @@ 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;
After 'cnt = list_count_nodes(...)', this initializer is not necessary.
As well as other two cases.