staging: rtl8723au: core: rtw_recv: use list_first_entry()
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2cb5780a41
commit
4b279420ac
|
@ -1522,7 +1522,7 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
|
||||||
struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
|
struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter,
|
||||||
struct rtw_queue *defrag_q)
|
struct rtw_queue *defrag_q)
|
||||||
{
|
{
|
||||||
struct list_head *plist, *phead;
|
struct list_head *phead;
|
||||||
u8 wlanhdr_offset;
|
u8 wlanhdr_offset;
|
||||||
u8 curfragnum;
|
u8 curfragnum;
|
||||||
struct recv_frame *pnfhdr, *ptmp;
|
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;
|
pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
|
||||||
|
|
||||||
phead = get_list_head(defrag_q);
|
phead = get_list_head(defrag_q);
|
||||||
plist = phead->next;
|
prframe = list_first_entry(phead, struct recv_frame, list);
|
||||||
prframe = container_of(plist, struct recv_frame, list);
|
|
||||||
list_del_init(&prframe->list);
|
list_del_init(&prframe->list);
|
||||||
skb = prframe->pkt;
|
skb = prframe->pkt;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue