From: Fabio M. De Francesco Date: Mon, 2 Aug 2021 00:55:17 +0000 (+0200) Subject: staging: r8188eu: core: Remove rtw_mfree_all_stainfo() X-Git-Tag: v5.15~425^2~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d229f0fb10250173989d2086073ff702980ef48b;p=platform%2Fkernel%2Flinux-starfive.git staging: r8188eu: core: Remove rtw_mfree_all_stainfo() Remove rtw_mfree_all_stainfo() and the only line of code that calls it. This function simply takes a spinlock and iterates over a list with no purpose. That iteration has no side effects. Signed-off-by: Fabio M. De Francesco Acked-by: Larry Finger Acked-by: Dan Carpenter Link: https://lore.kernel.org/r/20210802005517.12815-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/core/rtw_sta_mgt.c b/drivers/staging/r8188eu/core/rtw_sta_mgt.c index 93cd1db..4f62ef3 100644 --- a/drivers/staging/r8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/r8188eu/core/rtw_sta_mgt.c @@ -161,34 +161,12 @@ void rtw_mfree_stainfo(struct sta_info *psta) } -/* this function is used to free the memory of lock || sema for all stainfos */ -void rtw_mfree_all_stainfo(struct sta_priv *pstapriv); -void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) -{ - struct list_head *plist, *phead; - struct sta_info *psta = NULL; - - spin_lock_bh(&pstapriv->sta_hash_lock); - - phead = get_list_head(&pstapriv->free_sta_queue); - plist = phead->next; - - while (phead != plist) { - psta = container_of(plist, struct sta_info, list); - plist = plist->next; - } - - spin_unlock_bh(&pstapriv->sta_hash_lock); -} - static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) { #ifdef CONFIG_88EU_AP_MODE struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; #endif - rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ - _rtw_spinlock_free(&pstapriv->free_sta_queue.lock); _rtw_spinlock_free(&pstapriv->sta_hash_lock);