Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742550

[PATCH 5/6] Staging: rtl8188eu: core: Use list_entry instead of container_of

From Srishti Sharma <srishtishar@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 5/6] Staging: rtl8188eu: core: Use list_entry instead of container_of
Date 2017-09-30 09:30 +0200
Message-ID <uvknM-12H-33@gated-at.bofh.it> (permalink)
References <uvke5-YT-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


For variables of type struct list_head* use list_entry to access
current list element instead of using container_of. Done using
the following semantic patch by coccinelle.

@r@
struct list_head* l;
@@

-container_of
+list_entry
   (l,...)

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 611c940..80fe6ae 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -1790,7 +1790,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
 			u8 *p;
 			struct wlan_bssid_ex *pbss_network;
 
-			pnetwork = container_of(plist, struct wlan_network, list);
+			pnetwork = list_entry(plist, struct wlan_network, list);
 
 			plist = plist->next;
 
@@ -5470,7 +5470,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
 			xmitframe_plist = xmitframe_phead->next;
 
 			while (xmitframe_phead != xmitframe_plist) {
-				pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
+				pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, list);
 
 				xmitframe_plist = xmitframe_plist->next;
 
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Replace container_of with list_entry Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:20 +0200
  [PATCH 1/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:20 +0200
  [PATCH 2/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:20 +0200
  [PATCH 3/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:30 +0200
  [PATCH 4/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:30 +0200
  [PATCH 6/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:30 +0200
    Re: [Outreachy kernel] [PATCH 6/6] Staging: rtl8188eu: core: Use  list_entry instead of container_of Julia Lawall <julia.lawall@lip6.fr> - 2017-09-30 10:40 +0200
  [PATCH 5/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma <srishtishar@gmail.com> - 2017-09-30 09:30 +0200
  Re: [PATCH 0/6] Replace container_of with list_entry "Tobin C. Harding" <me@tobin.cc> - 2017-09-30 13:20 +0200

csiph-web