Skip to contentSkip to conversation

staging: rtl8723au: core: rtw_sta_mgt.c: Replace container_of()

PATCH New Janani Ravichandran 1 participant 1 message Feb 28, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723au: core: rtw_sta_mgt.c: Replace container_of()

Use list_entry() rather than container_of() for linked list nodes. Semantic patch used:

@a exists@
identifier var;
struct list_head *ptr;
@@

var =
- container_of
+ list_entry
(ptr, ...);

---
 drivers/staging/rtl8723au/core/rtw_sta_mgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/core/rtw_sta_mgt.c +1 -1
index 22d857b..be3fc55 100644
@@ -275,7 +275,7 @@ int rtw_free_stainfo23a(struct rtw_adapter *padapter, struct sta_info *psta)
 		plist = phead->next;
 
 		while (!list_empty(phead)) {
-			prframe = container_of(plist, struct recv_frame, list);
+			prframe = list_entry(plist, struct recv_frame, list);
 			plist = plist->next;
 			list_del_init(&prframe->list);
 			rtw_free_recvframe23a(prframe);
Signature · 1 line
2.5.0