Skip to contentSkip to conversation

staging: rtl8723au: core: rtw_xmit.c: Replace container_of

PATCH In review Janani Ravichandran 2 participants 2 messages Feb 28, 2016 – Mar 11, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723au: core: rtw_xmit.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_xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723au/core/rtw_xmit.c +2 -2
index b82b182..5a74bbe 100644
@@ -1459,7 +1459,7 @@ static struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)
 
 		plist = phead->next;
 
-		pxframe = container_of(plist, struct xmit_frame, list);
+		pxframe = list_entry(plist, struct xmit_frame, list);
 
 		list_del_init(&pxframe->list);
 		pxmitpriv->free_xmitframe_cnt--;
@@ -1491,7 +1491,7 @@ struct xmit_frame *rtw_alloc_xmitframe23a_ext(struct xmit_priv *pxmitpriv)
 	} else {
 		phead = get_list_head(queue);
 		plist = phead->next;
-		pxframe = container_of(plist, struct xmit_frame, list);
+		pxframe = list_entry(plist, struct xmit_frame, list);
 
 		list_del_init(&pxframe->list);
 		pxmitpriv->free_xframe_ext_cnt--;
Signature · 1 line
2.5.0
maintainer
#1 lore raw
Quoted 13 lines · Janani Ravichandran

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, ...);

Quoted 4 lines
---
 drivers/staging/rtl8723au/core/rtw_xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Your patches for this driver break the build :(

Please retest all of them, and resend all of them in a patch series, so I know what order to apply them in.

thanks,

greg k-h