Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8188eu: remove function which does nothing

The function rtw_mfree_all_stainfo() is just holding the lock,
traversing the list, and then unlocking. It is not doing anything else.
So removed the function and modified the places from where it was called.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sudip Mukherjee and committed by
Greg Kroah-Hartman
4e18248a 9393d34e

-28
-28
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
··· 143 143 return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info)); 144 144 } 145 145 146 - /* this function is used to free the memory of lock || sema for all stainfos */ 147 - static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) 148 - { 149 - struct list_head *plist, *phead; 150 - struct sta_info *psta = NULL; 151 - 152 - 153 - spin_lock_bh(&pstapriv->sta_hash_lock); 154 - 155 - phead = get_list_head(&pstapriv->free_sta_queue); 156 - plist = phead->next; 157 - 158 - while (phead != plist) { 159 - psta = container_of(plist, struct sta_info, list); 160 - plist = plist->next; 161 - } 162 - 163 - spin_unlock_bh(&pstapriv->sta_hash_lock); 164 - 165 - } 166 - 167 - static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) 168 - { 169 - rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ 170 - } 171 - 172 146 u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) 173 147 { 174 148 struct list_head *phead, *plist; ··· 170 196 } 171 197 spin_unlock_bh(&pstapriv->sta_hash_lock); 172 198 /*===============================*/ 173 - 174 - rtw_mfree_sta_priv_lock(pstapriv); 175 199 176 200 if (pstapriv->pallocated_stainfo_buf) 177 201 vfree(pstapriv->pallocated_stainfo_buf);