Return-path: Received: from m50-132.163.com ([123.125.50.132]:48217 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754358AbcCAPgi (ORCPT ); Tue, 1 Mar 2016 10:36:38 -0500 From: Geliang Tang To: Larry Finger , Jes Sorensen , Greg Kroah-Hartman , Julian Calaby Cc: Geliang Tang , 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 Message-Id: <02a8be1627748f73df967fe4e55d98f6f0b01562.1456845896.git.geliangtang@163.com> (sfid-20160301_163822_946845_38487405) In-Reply-To: References: In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org List-ID: Use list_first_entry() instead of container_of() to simplify the code. Signed-off-by: Geliang Tang Acked-by: Jes Sorensen --- 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