From: Geliang Tang <geliangtang@163.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
Jes Sorensen <Jes.Sorensen@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Julian Calaby <julian.calaby@gmail.com>
Cc: Geliang Tang <geliangtang@163.com>,
linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] staging: rtl8723au: core: rtw_recv: use list_first_entry()
Date: Tue, 1 Mar 2016 23:35:33 +0800 [thread overview]
Message-ID: <02a8be1627748f73df967fe4e55d98f6f0b01562.1456845896.git.geliangtang@163.com> (raw)
In-Reply-To: <cover.1456845896.git.geliangtang@163.com>
In-Reply-To: <ad37740a77700b2c0ebb5b3d8977a78af6874067.1456845896.git.geliangtang@163.com>
Use list_first_entry() instead of container_of() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/staging/rtl8723au/core/rtw_recv.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c
index a4dacc3..ceb4a07 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -1522,7 +1522,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
struct rtw_queue *defrag_q)
{
- struct list_head *plist, *phead;
+ struct list_head *phead;
u8 wlanhdr_offset;
u8 curfragnum;
struct recv_frame *pnfhdr, *ptmp;
@@ -1534,8 +1534,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
phead = get_list_head(defrag_q);
- plist = phead->next;
- prframe = container_of(plist, struct recv_frame, list);
+ prframe = list_first_entry(phead, struct recv_frame, list);
list_del_init(&prframe->list);
skb = prframe->pkt;
--
2.5.0
prev parent reply other threads:[~2016-03-01 15:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 0:38 [PATCH] staging: rtl8723au: use list_first_entry* Geliang Tang
2016-02-23 2:39 ` Jes Sorensen
2016-03-01 15:35 ` [PATCH v2 0/3] " Geliang Tang
2016-03-01 15:35 ` [PATCH v2 1/3] staging: rtl8723au: core: rtw_recv: use list_first_entry_or_null() Geliang Tang
2016-03-01 15:35 ` [PATCH v2 2/3] staging: rtl8723au: core: rtw_xmit: " Geliang Tang
2016-03-01 15:35 ` Geliang Tang [this message]
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=02a8be1627748f73df967fe4e55d98f6f0b01562.1456845896.git.geliangtang@163.com \
--to=geliangtang@163.com \
--cc=Jes.Sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=julian.calaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).