staging: r8188eu: Replace misspelled local container macro
authorLarry Finger <Larry.Finger@lwfinger.net>
Sun, 9 Feb 2014 21:15:57 +0000 (15:15 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 20:41:14 +0000 (12:41 -0800)
This driver has its own implementation of a "container_of" macro. It
is replaced with the standard container_of version. Most of these
are a straight one-to-one replacement; however, a few of the instances
referred to the member of a union. Those were replaced with the
struct that is part of that union.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 files changed:
drivers/staging/rtl8188eu/core/rtw_ap.c
drivers/staging/rtl8188eu/core/rtw_cmd.c
drivers/staging/rtl8188eu/core/rtw_debug.c
drivers/staging/rtl8188eu/core/rtw_mlme.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/core/rtw_p2p.c
drivers/staging/rtl8188eu/core/rtw_recv.c
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
drivers/staging/rtl8188eu/core/rtw_xmit.c
drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
drivers/staging/rtl8188eu/include/osdep_service.h
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
drivers/staging/rtl8188eu/os_dep/xmit_linux.c

index fe5ec8eba7f68c2d9c745bd8b2602f5edaf97b40..f32011cde44a541205807ef8cb3076d6a81e5da7 100644 (file)
@@ -289,7 +289,7 @@ void        expire_timeout_chk(struct adapter *padapter)
 
        /* check auth_queue */
        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, auth_list);
+               psta = container_of(plist, struct sta_info, auth_list);
                plist = get_next(plist);
 
                if (psta->expire_to > 0) {
@@ -323,7 +323,7 @@ void        expire_timeout_chk(struct adapter *padapter)
 
        /* check asoc_queue */
        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+               psta = container_of(plist, struct sta_info, asoc_list);
                plist = get_next(plist);
 
                if (chk_sta_is_alive(psta) || !psta->expire_to) {
@@ -1147,7 +1147,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
        plist = get_next(phead);
 
        while (!rtw_end_of_queue_search(phead, plist)) {
-               paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
+               paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
                plist = get_next(plist);
 
                if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
@@ -1208,7 +1208,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
        plist = get_next(phead);
 
        while (!rtw_end_of_queue_search(phead, plist)) {
-               paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
+               paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
                plist = get_next(plist);
 
                if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
@@ -1507,7 +1507,7 @@ void associated_clients_update(struct adapter *padapter, u8 updated)
 
                /* check asoc_queue */
                while ((rtw_end_of_queue_search(phead, plist)) == false) {
-                       psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+                       psta = container_of(plist, struct sta_info, asoc_list);
 
                        plist = get_next(plist);
 
@@ -1781,7 +1781,7 @@ int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
 
        /* for each sta in asoc_queue */
        while (!rtw_end_of_queue_search(phead, plist)) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+               psta = container_of(plist, struct sta_info, asoc_list);
                plist = get_next(plist);
 
                issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset);
@@ -1815,7 +1815,7 @@ int rtw_sta_flush(struct adapter *padapter)
 
        /* free sta asoc_queue */
        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+               psta = container_of(plist, struct sta_info, asoc_list);
 
                plist = get_next(plist);
 
@@ -1944,7 +1944,7 @@ void stop_ap_mode(struct adapter *padapter)
        phead = get_list_head(pacl_node_q);
        plist = get_next(phead);
        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-               paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
+               paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
                plist = get_next(plist);
 
                if (paclnode->valid) {
index 82fe8c47a1de3f689cae5ebe1db9641f4d104517..d24252de84f93a9205bf92823b7a731db193e896 100644 (file)
@@ -173,7 +173,7 @@ _func_enter_;
        if (rtw_is_list_empty(&(queue->queue))) {
                obj = NULL;
        } else {
-               obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list);
+               obj = container_of(get_next(&(queue->queue)), struct cmd_obj, list);
                rtw_list_delete(&obj->list);
        }
 
index af32041a1e970dacde83ad24567a2cde29870953..76e7b7b582f04fda9192a53e6f4ce4d81c8d77c8 100644 (file)
@@ -854,7 +854,7 @@ int proc_get_all_sta_info(char *page, char **start,
                plist = get_next(phead);
 
                while ((rtw_end_of_queue_search(phead, plist)) == false) {
-                       psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
+                       psta = container_of(plist, struct sta_info, hash_list);
 
                        plist = get_next(plist);
 
index 4f482e23e78572f221799196cc1eeb8ddae9cbd2..55090d7074ddfa3bd0ea44ad9e21346138aaed53 100644 (file)
@@ -167,7 +167,7 @@ _func_enter_;
        if (_rtw_queue_empty(queue)) {
                pnetwork = NULL;
        } else {
-               pnetwork = LIST_CONTAINOR(get_next(&queue->queue), struct wlan_network, list);
+               pnetwork = container_of(get_next(&queue->queue), struct wlan_network, list);
 
                rtw_list_delete(&(pnetwork->list));
        }
@@ -195,7 +195,7 @@ _func_enter_;
        }
        plist = get_next(&(free_queue->queue));
 
-       pnetwork = LIST_CONTAINOR(plist , struct wlan_network, list);
+       pnetwork = container_of(plist , struct wlan_network, list);
 
        rtw_list_delete(&pnetwork->list);
 
@@ -285,7 +285,7 @@ _func_enter_;
        plist = get_next(phead);
 
        while (plist != phead) {
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network , list);
+               pnetwork = container_of(plist, struct wlan_network , list);
                if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN) == true)
                        break;
                plist = get_next(plist);
@@ -314,7 +314,7 @@ _func_enter_;
        plist = get_next(phead);
 
        while (rtw_end_of_queue_search(phead, plist) == false) {
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
 
                plist = get_next(plist);
 
@@ -500,7 +500,7 @@ _func_enter_;
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pwlan = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pwlan = container_of(plist, struct wlan_network, list);
 
                if (!pwlan->fixed) {
                        if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned))
@@ -593,7 +593,7 @@ _func_enter_;
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork        = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork        = container_of(plist, struct wlan_network, list);
 
                if (is_same_network(&(pnetwork->network), target))
                        break;
@@ -1749,7 +1749,7 @@ _func_enter_;
        adapter = (struct adapter *)pmlmepriv->nic_hdl;
        pmlmepriv->pscanned = get_next(phead);
        while (!rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) {
-               pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list);
+               pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
                if (pnetwork == NULL) {
                        RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__));
                        ret = _FAIL;
index ce9658617f2e6553ec828869ab3d8260a3f7186e..8e923352d1e9fee2880dffc15af9679950623841 100644 (file)
@@ -6236,7 +6236,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
                        if (rtw_end_of_queue_search(phead, plist))
                                break;
 
-                       pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+                       pnetwork = container_of(plist, struct wlan_network, list);
 
                        plist = get_next(plist);
 
@@ -8375,7 +8375,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
                        xmitframe_plist = get_next(xmitframe_phead);
 
                        while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
-                               pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+                               pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
                                xmitframe_plist = get_next(xmitframe_plist);
 
index 4a9342dfeb900d51b530cff85ac960f64d917431..e91a2eeb20843ef0783abfe89f5b3b0d966469cf 100644 (file)
@@ -61,7 +61,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
 
        /* look up sta asoc_queue */
        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+               psta = container_of(plist, struct sta_info, asoc_list);
 
                plist = get_next(plist);
 
@@ -984,7 +984,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
 
                                        /* look up sta asoc_queue */
                                        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-                                               psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+                                               psta = container_of(plist, struct sta_info, asoc_list);
 
                                                plist = get_next(plist);
 
index b8951a63fa6a5725e9f7f4b99e401dc9cc2672b7..8ef31902f9281e647f777965726f8e0a36320d81 100644 (file)
@@ -138,23 +138,23 @@ _func_exit_;
 
 union recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
 {
-       union recv_frame  *precvframe;
+       struct recv_frame_hdr *hdr;
        struct list_head *plist, *phead;
        struct adapter *padapter;
        struct recv_priv *precvpriv;
 _func_enter_;
 
        if (_rtw_queue_empty(pfree_recv_queue)) {
-               precvframe = NULL;
+               hdr = NULL;
        } else {
                phead = get_list_head(pfree_recv_queue);
 
                plist = get_next(phead);
 
-               precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
+               hdr = container_of(plist, struct recv_frame_hdr, list);
 
-               rtw_list_delete(&precvframe->u.hdr.list);
-               padapter = precvframe->u.hdr.adapter;
+               rtw_list_delete(&hdr->list);
+               padapter = hdr->adapter;
                if (padapter != NULL) {
                        precvpriv = &padapter->recvpriv;
                        if (pfree_recv_queue == &precvpriv->free_recv_queue)
@@ -164,7 +164,7 @@ _func_enter_;
 
 _func_exit_;
 
-       return precvframe;
+       return (union recv_frame *)hdr;
 }
 
 union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
@@ -264,7 +264,7 @@ using spinlock to protect
 
 void rtw_free_recvframe_queue(struct __queue *pframequeue,  struct __queue *pfree_recv_queue)
 {
-       union   recv_frame      *precvframe;
+       struct recv_frame_hdr *hdr;
        struct list_head *plist, *phead;
 
 _func_enter_;
@@ -274,11 +274,11 @@ _func_enter_;
        plist = get_next(phead);
 
        while (rtw_end_of_queue_search(phead, plist) == false) {
-               precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
+               hdr = container_of(plist, struct recv_frame_hdr, list);
 
                plist = get_next(plist);
 
-               rtw_free_recvframe(precvframe, pfree_recv_queue);
+               rtw_free_recvframe((union recv_frame *)hdr, pfree_recv_queue);
        }
 
        spin_unlock(&pframequeue->lock);
@@ -338,7 +338,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue)
 
                plist = get_next(phead);
 
-               precvbuf = LIST_CONTAINOR(plist, struct recv_buf, list);
+               precvbuf = container_of(plist, struct recv_buf, list);
 
                rtw_list_delete(&precvbuf->list);
        }
@@ -1100,7 +1100,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
                        xmitframe_plist = get_next(xmitframe_phead);
 
                        if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) {
-                               pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+                               pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
                                xmitframe_plist = get_next(xmitframe_plist);
 
@@ -1516,8 +1516,8 @@ _func_enter_;
 
        phead = get_list_head(defrag_q);
        plist = get_next(phead);
-       prframe = LIST_CONTAINOR(plist, union recv_frame, u);
-       pfhdr = &prframe->u.hdr;
+       pfhdr = container_of(plist, struct recv_frame_hdr, list);
+       prframe = (union recv_frame *)pfhdr;
        rtw_list_delete(&(prframe->u.list));
 
        if (curfragnum != pfhdr->attrib.frag_num) {
@@ -1536,8 +1536,8 @@ _func_enter_;
        plist = get_next(plist);
 
        while (rtw_end_of_queue_search(phead, plist) == false) {
-               pnextrframe = LIST_CONTAINOR(plist, union recv_frame , u);
-               pnfhdr = &pnextrframe->u.hdr;
+               pnfhdr = container_of(plist, struct recv_frame_hdr , list);
+               pnextrframe = (union recv_frame *)pnfhdr;
 
                /* check the fragment sequence  (2nd ~n fragment frame) */
 
@@ -1837,15 +1837,15 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec
        struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
        struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
        struct list_head *phead, *plist;
-       union recv_frame *pnextrframe;
+       struct recv_frame_hdr *hdr;
        struct rx_pkt_attrib *pnextattrib;
 
        phead = get_list_head(ppending_recvframe_queue);
        plist = get_next(phead);
 
        while (rtw_end_of_queue_search(phead, plist) == false) {
-               pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
-               pnextattrib = &pnextrframe->u.hdr.attrib;
+               hdr = container_of(plist, struct recv_frame_hdr, list);
+               pnextattrib = &hdr->attrib;
 
                if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
                        plist = get_next(plist);
@@ -1865,6 +1865,7 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
 {
        struct list_head *phead, *plist;
        union recv_frame *prframe;
+       struct recv_frame_hdr *prhdr;
        struct rx_pkt_attrib *pattrib;
        int bPktInBuf = false;
        struct recv_priv *precvpriv = &padapter->recvpriv;
@@ -1878,15 +1879,16 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
                if (rtw_is_list_empty(phead))
                        return true;
 
-               prframe = LIST_CONTAINOR(plist, union recv_frame, u);
-               pattrib = &prframe->u.hdr.attrib;
+               prhdr = container_of(plist, struct recv_frame_hdr, list);
+               pattrib = &prhdr->attrib;
                preorder_ctrl->indicate_seq = pattrib->seq_num;
        }
 
        /*  Prepare indication list and indication. */
        /*  Check if there is any packet need indicate. */
        while (!rtw_is_list_empty(phead)) {
-               prframe = LIST_CONTAINOR(plist, union recv_frame, u);
+               prhdr = container_of(plist, struct recv_frame_hdr, list);
+               prframe = (union recv_frame *)prhdr;
                pattrib = &prframe->u.hdr.attrib;
 
                if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
index 0441bcc1288b23b293ddde588a9748f61f3232a4..6f870b87c0ac90d67611e5f4cdff262726e3cef3 100644 (file)
@@ -163,7 +163,7 @@ _func_enter_;
        plist = get_next(phead);
 
        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-               psta = LIST_CONTAINOR(plist, struct sta_info , list);
+               psta = container_of(plist, struct sta_info , list);
                plist = get_next(plist);
        }
 
@@ -194,7 +194,7 @@ _func_enter_;
 
                        while ((rtw_end_of_queue_search(phead, plist)) == false) {
                                int i;
-                               psta = LIST_CONTAINOR(plist, struct sta_info , hash_list);
+                               psta = container_of(plist, struct sta_info , hash_list);
                                plist = get_next(plist);
 
                                for (i = 0; i < 16; i++) {
@@ -236,7 +236,7 @@ _func_enter_;
                spin_unlock_bh(&pfree_sta_queue->lock);
                psta = NULL;
        } else {
-               psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
+               psta = container_of(get_next(&pfree_sta_queue->queue), struct sta_info, list);
                rtw_list_delete(&(psta->list));
                spin_unlock_bh(&pfree_sta_queue->lock);
                _rtw_init_stainfo(psta);
@@ -359,6 +359,7 @@ _func_enter_;
        /* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
        for (i = 0; i < 16; i++) {
                struct list_head *phead, *plist;
+               struct recv_frame_hdr *prhdr;
                union recv_frame *prframe;
                struct __queue *ppending_recvframe_queue;
                struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
@@ -375,7 +376,8 @@ _func_enter_;
                plist = get_next(phead);
 
                while (!rtw_is_list_empty(phead)) {
-                       prframe = LIST_CONTAINOR(plist, union recv_frame, u);
+                       prhdr = container_of(plist, struct recv_frame_hdr, list);
+                       prframe = (union recv_frame *)prhdr;
 
                        plist = get_next(plist);
 
@@ -455,7 +457,7 @@ _func_enter_;
                plist = get_next(phead);
 
                while ((!rtw_end_of_queue_search(phead, plist))) {
-                       psta = LIST_CONTAINOR(plist, struct sta_info , hash_list);
+                       psta = container_of(plist, struct sta_info , hash_list);
 
                        plist = get_next(plist);
 
@@ -498,7 +500,7 @@ _func_enter_;
        plist = get_next(phead);
 
        while ((!rtw_end_of_queue_search(phead, plist))) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
+               psta = container_of(plist, struct sta_info, hash_list);
 
                if ((!memcmp(psta->hwaddr, addr, ETH_ALEN)) == true) {
                        /*  if found the matched address */
@@ -564,7 +566,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
        phead = get_list_head(pacl_node_q);
        plist = get_next(phead);
        while ((!rtw_end_of_queue_search(phead, plist))) {
-               paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
+               paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
                plist = get_next(plist);
 
                if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) {
index e64607cb863287a6ab8138877eb1b0029a905be5..8658ba655380f3adcfd70ad6cd8201de1cc50af6 100644 (file)
@@ -1261,7 +1261,7 @@ _func_enter_;
 
                plist = get_next(phead);
 
-               pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
+               pxmitbuf = container_of(plist, struct xmit_buf, list);
 
                rtw_list_delete(&(pxmitbuf->list));
        }
@@ -1329,7 +1329,7 @@ _func_enter_;
 
                plist = get_next(phead);
 
-               pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
+               pxmitbuf = container_of(plist, struct xmit_buf, list);
 
                rtw_list_delete(&(pxmitbuf->list));
        }
@@ -1417,7 +1417,7 @@ _func_enter_;
 
                plist = get_next(phead);
 
-               pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
+               pxframe = container_of(plist, struct xmit_frame, list);
 
                rtw_list_delete(&(pxframe->list));
        }
@@ -1501,7 +1501,7 @@ _func_enter_;
        plist = get_next(phead);
 
        while (!rtw_end_of_queue_search(phead, plist)) {
-               pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
+               pxmitframe = container_of(plist, struct xmit_frame, list);
 
                plist = get_next(plist);
 
@@ -1533,7 +1533,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
        xmitframe_plist = get_next(xmitframe_phead);
 
        if (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
-               pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+               pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
                xmitframe_plist = get_next(xmitframe_plist);
 
@@ -1575,7 +1575,7 @@ _func_enter_;
                sta_plist = get_next(sta_phead);
 
                while (!rtw_end_of_queue_search(sta_phead, sta_plist)) {
-                       ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending);
+                       ptxservq = container_of(sta_plist, struct tx_servq, tx_pending);
 
                        pframe_queue = &ptxservq->sta_pending;
 
@@ -2073,7 +2073,7 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc
        plist = get_next(phead);
 
        while (!rtw_end_of_queue_search(phead, plist)) {
-               pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
+               pxmitframe = container_of(plist, struct xmit_frame, list);
 
                plist = get_next(plist);
 
@@ -2140,7 +2140,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
        xmitframe_plist = get_next(xmitframe_phead);
 
        while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
-               pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+               pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
                xmitframe_plist = get_next(xmitframe_plist);
 
@@ -2221,7 +2221,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
                xmitframe_plist = get_next(xmitframe_phead);
 
                while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
-                       pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+                       pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
                        xmitframe_plist = get_next(xmitframe_plist);
 
@@ -2268,7 +2268,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
        xmitframe_plist = get_next(xmitframe_phead);
 
        while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
-               pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+               pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
 
                xmitframe_plist = get_next(xmitframe_plist);
 
index 6fb6a46f04fe362b2bedc5cc3e1686664f85d6c5..50bc215b12ba1b88940d14c1e14e5327549ab24d 100644 (file)
@@ -540,7 +540,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
        xmitframe_plist = get_next(xmitframe_phead);
 
        while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
-               pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
+               pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
                xmitframe_plist = get_next(xmitframe_plist);
 
                pxmitframe->agg_num = 0; /*  not first frame of aggregation */
index e726ff8d0464cb9d7f9c94ab1cbf032a457ffc86..59399210a8912f83842dc9b180db297e1bc14474 100644 (file)
@@ -72,10 +72,6 @@ static inline struct list_head *get_list_head(struct __queue *queue)
        return &(queue->queue);
 }
 
-
-#define LIST_CONTAINOR(ptr, type, member) \
-       ((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
-
 static inline int _enter_critical_mutex(struct mutex *pmutex,
                                        unsigned long *pirqL)
 {
index f3584dd832e29641ad0ca8e99c6900627aec1f49..f9e52b3ac876322479d36d77e5fc47d84078c7a3 100644 (file)
@@ -1145,7 +1145,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
                if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list);
+               pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
 
                pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
 
@@ -1452,7 +1452,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
                        break;
                }
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
 
                /* report network only if the current channel set contains the channel to which this network belongs */
                if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0)
@@ -1541,7 +1541,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
                                break;
                        }
 
-                       pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list);
+                       pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
 
                        pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
 
@@ -2614,7 +2614,7 @@ static int rtw_get_ap_info(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
 
                if (hwaddr_aton_i(data, bssid)) {
                        DBG_88E("Invalid BSSID '%s'.\n", (u8 *)data);
@@ -3117,7 +3117,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
                if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
                        u8 *wpsie;
                        uint wpsie_len = 0;
@@ -3187,7 +3187,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
                if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
                        /*      Commented by Albert 2011/05/18 */
                        /*      Match the device address located in the P2P IE */
@@ -3271,7 +3271,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
                if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
                        u8 *wpsie;
                        uint wpsie_len = 0;
@@ -3350,7 +3350,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
                if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
                        u8 *wpsie;
                        uint wpsie_len = 0;
@@ -3421,7 +3421,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
                if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
                        /*      Commented by Albert 20121226 */
                        /*      Match the device address located in the P2P IE */
@@ -3503,7 +3503,7 @@ static int rtw_p2p_connect(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
                if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
                        uintPeerChannel = pnetwork->network.Configuration.DSConfig;
                        break;
@@ -3598,7 +3598,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
                if (rtw_end_of_queue_search(phead, plist) == true)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
 
                /*      Commented by Albert 2011/05/18 */
                /*      Match the device address located in the P2P IE */
@@ -3751,7 +3751,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
                if (uintPeerChannel != 0)
                        break;
 
-               pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
+               pnetwork = container_of(plist, struct wlan_network, list);
 
                /*      Commented by Albert 2011/05/18 */
                /*      Match the device address located in the P2P IE */
@@ -4440,7 +4440,7 @@ static int rtw_dbg_port(struct net_device *dev,
                                        plist = get_next(phead);
 
                                        while ((rtw_end_of_queue_search(phead, plist)) == false) {
-                                               psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
+                                               psta = container_of(plist, struct sta_info, hash_list);
 
                                                plist = get_next(plist);
 
index 8097903f3b682e919f54966a404cf2fb2bb126f2..c1b7c9629edf8dba87bc9d3c8264bac1f0947d44 100644 (file)
@@ -202,7 +202,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
 
        /* free sta asoc_queue */
        while (!rtw_end_of_queue_search(phead, plist)) {
-               psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
+               psta = container_of(plist, struct sta_info, asoc_list);
 
                plist = get_next(plist);