mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srishti Sharma <srishtishar@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	outreachy-kernel@googlegroups.com,
	Srishti Sharma <srishtishar@gmail.com>
Subject: [PATCH 5/6] Staging: rtl8188eu: core: Use list_entry instead of container_of
Date: Sat, 30 Sep 2017 12:50:57 +0530	[thread overview]
Message-ID: <deef34ad5b963ac49fc8086675af24db68bdc8c5.1506755265.git.srishtishar@gmail.com> (raw)
In-Reply-To: <cover.1506755265.git.srishtishar@gmail.com>

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

  parent reply	other threads:[~2017-09-30  7:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30  7:19 [PATCH 0/6] Replace container_of with list_entry Srishti Sharma
2017-09-30  7:19 ` [PATCH 1/6] Staging: rtl8188eu: core: Use list_entry instead of container_of Srishti Sharma
2017-09-30  7:19 ` [PATCH 2/6] " Srishti Sharma
2017-09-30  7:20 ` [PATCH 3/6] " Srishti Sharma
2017-09-30  7:20 ` [PATCH 4/6] " Srishti Sharma
2017-09-30  7:20 ` Srishti Sharma [this message]
2017-09-30  7:21 ` [PATCH 6/6] " Srishti Sharma
2017-09-30  8:31   ` [Outreachy kernel] " Julia Lawall
2017-09-30 11:11 ` [PATCH 0/6] Replace container_of with list_entry Tobin C. Harding
2017-10-03 16:14 ` Greg KH
2017-10-03 16:30   ` Srishti Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=deef34ad5b963ac49fc8086675af24db68bdc8c5.1506755265.git.srishtishar@gmail.com \
    --to=srishtishar@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®