Commit 67af9094 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_of

These are similar macros so use the normal kernel one.

As well, there are odd games being played with casting a plist to
a union recv_frame by using LIST_CONTAINOR.  Just use a direct cast
to union recv_frame instead.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4379c365
...@@ -129,7 +129,7 @@ union recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue) ...@@ -129,7 +129,7 @@ union recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
plist = get_next(phead); plist = get_next(phead);
precvframe = LIST_CONTAINOR(plist, union recv_frame, u); precvframe = (union recv_frame *)plist;
list_del_init(&precvframe->u.hdr.list); list_del_init(&precvframe->u.hdr.list);
padapter = precvframe->u.hdr.adapter; padapter = precvframe->u.hdr.adapter;
...@@ -243,7 +243,7 @@ void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfre ...@@ -243,7 +243,7 @@ void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfre
plist = get_next(phead); plist = get_next(phead);
while (phead != plist) { while (phead != plist) {
precvframe = LIST_CONTAINOR(plist, union recv_frame, u); precvframe = (union recv_frame *)plist;
plist = get_next(plist); plist = get_next(plist);
...@@ -1732,7 +1732,7 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter, ...@@ -1732,7 +1732,7 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter,
phead = get_list_head(defrag_q); phead = get_list_head(defrag_q);
plist = get_next(phead); plist = get_next(phead);
prframe = LIST_CONTAINOR(plist, union recv_frame, u); prframe = (union recv_frame *)plist;
pfhdr = &prframe->u.hdr; pfhdr = &prframe->u.hdr;
list_del_init(&(prframe->u.list)); list_del_init(&(prframe->u.list));
...@@ -1754,7 +1754,7 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter, ...@@ -1754,7 +1754,7 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter,
data = get_recvframe_data(prframe); data = get_recvframe_data(prframe);
while (phead != plist) { while (phead != plist) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextrframe = (union recv_frame *)plist;
pnfhdr = &pnextrframe->u.hdr; pnfhdr = &pnextrframe->u.hdr;
...@@ -2071,7 +2071,7 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec ...@@ -2071,7 +2071,7 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec
plist = get_next(phead); plist = get_next(phead);
while (phead != plist) { while (phead != plist) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextrframe = (union recv_frame *)plist;
pnextattrib = &pnextrframe->u.hdr.attrib; pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
...@@ -2146,7 +2146,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr ...@@ -2146,7 +2146,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
return true; return true;
} }
prframe = LIST_CONTAINOR(plist, union recv_frame, u); prframe = (union recv_frame *)plist;
pattrib = &prframe->u.hdr.attrib; pattrib = &prframe->u.hdr.attrib;
#ifdef DBG_RX_SEQ #ifdef DBG_RX_SEQ
...@@ -2162,7 +2162,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr ...@@ -2162,7 +2162,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
/* Check if there is any packet need indicate. */ /* Check if there is any packet need indicate. */
while (!list_empty(phead)) { while (!list_empty(phead)) {
prframe = LIST_CONTAINOR(plist, union recv_frame, u); prframe = (union recv_frame *)plist;
pattrib = &prframe->u.hdr.attrib; pattrib = &prframe->u.hdr.attrib;
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
......
...@@ -429,7 +429,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) ...@@ -429,7 +429,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
plist = get_next(phead); plist = get_next(phead);
while (!list_empty(phead)) { while (!list_empty(phead)) {
prframe = LIST_CONTAINOR(plist, union recv_frame, u); prframe = (union recv_frame *)plist;
plist = get_next(plist); plist = get_next(plist);
......
...@@ -86,7 +86,7 @@ __inline static struct list_head *get_list_head(struct __queue *queue) ...@@ -86,7 +86,7 @@ __inline static struct list_head *get_list_head(struct __queue *queue)
#define LIST_CONTAINOR(ptr, type, member) \ #define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(__kernel_size_t)(&((type *)0)->member))) container_of(ptr, type, member)
#define RTW_TIMER_HDL_ARGS void *FunctionContext #define RTW_TIMER_HDL_ARGS void *FunctionContext
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment