staging: rtl8188eu: os_dep: Use list_entry() rather than container_of()
PATCH 1/1 staging: rtl8188eu: os_dep: Use list_entry() rather than container_of()
Use list_entry() rather than container_of() with linked list nodes. Semantic patch used:
@a exists@
identifier var;
struct list_head *ptr;
@@
var =
- container_of
+ list_entry
(ptr, ...);
Signed-off-by Janani Ravichandran <[email protected]>
--- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/os_dep/xmit_linux.c +1 -1
@@ -178,7 +178,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)/* free sta asoc_queue */ while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); + psta = list_entry(plist, struct sta_info, asoc_list); plist = plist->next;
Signature · 1 line
2.5.0
Quoted 23 lines · Janani Ravichandran
Use
list_entry()rather thancontainer_of()with linked list nodes. Semantic patch used:@a exists@
identifier var;
structlist_head*ptr;
@@var =
-container_of
+list_entry
(ptr, ...);Signed-off-by Janani Ravichandran <[email protected]>--- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8188eu/os_dep/xmit_linux.c +0
-0
drivers/staging/rtl8188eu/os_dep/xmit_linux.c static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb) · line 180
Quoted 3 lines
drivers/staging/rtl8188eu/os_dep/xmit_linux.c +0
-0@@ -178,7 +178,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)/* free sta asoc_queue */ while (phead != plist) {
This may be another hidden list_for_each. This time the list doesn't become empty.
julia
Quoted 15 lines
drivers/staging/rtl8188eu/os_dep/xmit_linux.c +1
-1- psta = container_of(plist, struct sta_info, asoc_list); + psta = list_entry(plist, struct sta_info, asoc_list); plist = plist->next;Signature · 8 lines
2.5.0 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160228185658.GA5218%40janani-Inspiron-3521. For more options, visit https://groups.google.com/d/optout.