staging: rtl8712: remove wrapper function list_insert_tail

list_insert_tail is just an inline wrapper around list_add_tail.  This
patch removes the wrapper and directly uses list_add_tail.

Signed-off-by: James A Shackleford <shack@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
James A Shackleford 2014-06-24 22:52:36 -04:00 committed by Greg Kroah-Hartman
parent 9672b1bd83
commit fdfbf7890d
9 changed files with 24 additions and 30 deletions

View File

@ -115,12 +115,6 @@ For the following list_xxx operations,
caller must guarantee the atomic context. caller must guarantee the atomic context.
Otherwise, there will be racing condition. Otherwise, there will be racing condition.
*/ */
static inline void list_insert_tail(struct list_head *plist,
struct list_head *phead)
{
list_add_tail(plist, phead);
}
static inline u32 _down_sema(struct semaphore *sema) static inline u32 _down_sema(struct semaphore *sema)
{ {
if (down_interruptible(sema)) if (down_interruptible(sema))

View File

@ -73,7 +73,7 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter)
break; break;
precvbuf->ref_cnt = 0; precvbuf->ref_cnt = 0;
precvbuf->adapter = padapter; precvbuf->adapter = padapter;
list_insert_tail(&precvbuf->list, list_add_tail(&precvbuf->list,
&(precvpriv->free_recv_buf_queue.queue)); &(precvpriv->free_recv_buf_queue.queue));
precvbuf++; precvbuf++;
} }
@ -146,7 +146,7 @@ int r8712_free_recvframe(union recv_frame *precvframe,
} }
spin_lock_irqsave(&pfree_recv_queue->lock, irqL); spin_lock_irqsave(&pfree_recv_queue->lock, irqL);
list_delete(&(precvframe->u.hdr.list)); list_delete(&(precvframe->u.hdr.list));
list_insert_tail(&(precvframe->u.hdr.list), list_add_tail(&(precvframe->u.hdr.list),
get_list_head(pfree_recv_queue)); get_list_head(pfree_recv_queue));
if (padapter != NULL) { if (padapter != NULL) {
if (pfree_recv_queue == &precvpriv->free_recv_queue) if (pfree_recv_queue == &precvpriv->free_recv_queue)
@ -297,7 +297,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter,
} }
/* Then enqueue the 0~(n-1) fragment to the defrag_q */ /* Then enqueue the 0~(n-1) fragment to the defrag_q */
phead = get_list_head(pdefrag_q); phead = get_list_head(pdefrag_q);
list_insert_tail(&pfhdr->list, phead); list_add_tail(&pfhdr->list, phead);
prtnframe = NULL; prtnframe = NULL;
} else { } else {
/* can't find this ta's defrag_queue, so free this /* can't find this ta's defrag_queue, so free this
@ -312,7 +312,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter,
* enqueue the last fragment */ * enqueue the last fragment */
if (pdefrag_q != NULL) { if (pdefrag_q != NULL) {
phead = get_list_head(pdefrag_q); phead = get_list_head(pdefrag_q);
list_insert_tail(&pfhdr->list, phead); list_add_tail(&pfhdr->list, phead);
/*call recvframe_defrag to defrag*/ /*call recvframe_defrag to defrag*/
precv_frame = recvframe_defrag(padapter, pdefrag_q); precv_frame = recvframe_defrag(padapter, pdefrag_q);
prtnframe = precv_frame; prtnframe = precv_frame;
@ -512,7 +512,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
break; break;
} }
list_delete(&(prframe->u.hdr.list)); list_delete(&(prframe->u.hdr.list));
list_insert_tail(&(prframe->u.hdr.list), plist); list_add_tail(&(prframe->u.hdr.list), plist);
return true; return true;
} }

View File

@ -126,7 +126,7 @@ static sint _enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
if (obj == NULL) if (obj == NULL)
return _SUCCESS; return _SUCCESS;
spin_lock_irqsave(&queue->lock, irqL); spin_lock_irqsave(&queue->lock, irqL);
list_insert_tail(&obj->list, &queue->queue); list_add_tail(&obj->list, &queue->queue);
spin_unlock_irqrestore(&queue->lock, irqL); spin_unlock_irqrestore(&queue->lock, irqL);
return _SUCCESS; return _SUCCESS;
} }
@ -190,7 +190,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
return _FAIL; return _FAIL;
queue = &pcmdpriv->cmd_queue; queue = &pcmdpriv->cmd_queue;
spin_lock_irqsave(&queue->lock, irqL); spin_lock_irqsave(&queue->lock, irqL);
list_insert_tail(&obj->list, &queue->queue); list_add_tail(&obj->list, &queue->queue);
spin_unlock_irqrestore(&queue->lock, irqL); spin_unlock_irqrestore(&queue->lock, irqL);
up(&pcmdpriv->cmd_queue_sema); up(&pcmdpriv->cmd_queue_sema);
return _SUCCESS; return _SUCCESS;
@ -956,7 +956,7 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter,
goto createbss_cmd_fail; goto createbss_cmd_fail;
pwlan->last_scanned = jiffies; pwlan->last_scanned = jiffies;
} else } else
list_insert_tail(&(pwlan->list), list_add_tail(&(pwlan->list),
&pmlmepriv->scanned_queue.queue); &pmlmepriv->scanned_queue.queue);
pnetwork->Length = r8712_get_ndis_wlan_bssid_ex_sz(pnetwork); pnetwork->Length = r8712_get_ndis_wlan_bssid_ex_sz(pnetwork);
memcpy(&(pwlan->network), pnetwork, pnetwork->Length); memcpy(&(pwlan->network), pnetwork, pnetwork->Length);

View File

@ -132,7 +132,7 @@ uint r8712_alloc_io_queue(struct _adapter *adapter)
pio_req = (struct io_req *)(pio_queue->free_ioreqs_buf); pio_req = (struct io_req *)(pio_queue->free_ioreqs_buf);
for (i = 0; i < NUM_IOREQ; i++) { for (i = 0; i < NUM_IOREQ; i++) {
INIT_LIST_HEAD(&pio_req->list); INIT_LIST_HEAD(&pio_req->list);
list_insert_tail(&pio_req->list, &pio_queue->free_ioreqs); list_add_tail(&pio_req->list, &pio_queue->free_ioreqs);
pio_req++; pio_req++;
} }
if ((register_intf_hdl((u8 *)adapter, &(pio_queue->intf))) == _FAIL) if ((register_intf_hdl((u8 *)adapter, &(pio_queue->intf))) == _FAIL)

View File

@ -70,7 +70,7 @@ static sint _init_mlme_priv(struct _adapter *padapter)
pnetwork = (struct wlan_network *)pbuf; pnetwork = (struct wlan_network *)pbuf;
for (i = 0; i < MAX_BSS_CNT; i++) { for (i = 0; i < MAX_BSS_CNT; i++) {
INIT_LIST_HEAD(&(pnetwork->list)); INIT_LIST_HEAD(&(pnetwork->list));
list_insert_tail(&(pnetwork->list), list_add_tail(&(pnetwork->list),
&(pmlmepriv->free_bss_pool.queue)); &(pmlmepriv->free_bss_pool.queue));
pnetwork++; pnetwork++;
} }
@ -118,7 +118,7 @@ static void _free_network(struct mlme_priv *pmlmepriv,
return; return;
spin_lock_irqsave(&free_queue->lock, irqL); spin_lock_irqsave(&free_queue->lock, irqL);
list_delete(&pnetwork->list); list_delete(&pnetwork->list);
list_insert_tail(&pnetwork->list, &free_queue->queue); list_add_tail(&pnetwork->list, &free_queue->queue);
pmlmepriv->num_of_scanned--; pmlmepriv->num_of_scanned--;
spin_unlock_irqrestore(&free_queue->lock, irqL); spin_unlock_irqrestore(&free_queue->lock, irqL);
} }
@ -133,7 +133,7 @@ static void _free_network_nolock(struct mlme_priv *pmlmepriv,
if (pnetwork->fixed == true) if (pnetwork->fixed == true)
return; return;
list_delete(&pnetwork->list); list_delete(&pnetwork->list);
list_insert_tail(&pnetwork->list, get_list_head(free_queue)); list_add_tail(&pnetwork->list, get_list_head(free_queue));
pmlmepriv->num_of_scanned--; pmlmepriv->num_of_scanned--;
} }
@ -437,7 +437,7 @@ static void update_scanned_network(struct _adapter *adapter,
bssid_ex_sz = r8712_get_ndis_wlan_bssid_ex_sz(target); bssid_ex_sz = r8712_get_ndis_wlan_bssid_ex_sz(target);
target->Length = bssid_ex_sz; target->Length = bssid_ex_sz;
memcpy(&pnetwork->network, target, bssid_ex_sz); memcpy(&pnetwork->network, target, bssid_ex_sz);
list_insert_tail(&pnetwork->list, &queue->queue); list_add_tail(&pnetwork->list, &queue->queue);
} }
} else { } else {
/* we have an entry and we are going to update it. But /* we have an entry and we are going to update it. But

View File

@ -66,7 +66,7 @@ static int init_mp_priv(struct mp_priv *pmp_priv)
pmp_xmitframe = (struct mp_xmit_frame *)pmp_priv->pmp_xmtframe_buf; pmp_xmitframe = (struct mp_xmit_frame *)pmp_priv->pmp_xmtframe_buf;
for (i = 0; i < NR_MP_XMITFRAME; i++) { for (i = 0; i < NR_MP_XMITFRAME; i++) {
INIT_LIST_HEAD(&(pmp_xmitframe->list)); INIT_LIST_HEAD(&(pmp_xmitframe->list));
list_insert_tail(&(pmp_xmitframe->list), list_add_tail(&(pmp_xmitframe->list),
&(pmp_priv->free_mp_xmitqueue.queue)); &(pmp_priv->free_mp_xmitqueue.queue));
pmp_xmitframe->pkt = NULL; pmp_xmitframe->pkt = NULL;
pmp_xmitframe->frame_tag = MP_FRAMETAG; pmp_xmitframe->frame_tag = MP_FRAMETAG;

View File

@ -87,7 +87,7 @@ sint _r8712_init_recv_priv(struct recv_priv *precvpriv,
precvframe = (union recv_frame *)precvpriv->precv_frame_buf; precvframe = (union recv_frame *)precvpriv->precv_frame_buf;
for (i = 0; i < NR_RECVFRAME; i++) { for (i = 0; i < NR_RECVFRAME; i++) {
INIT_LIST_HEAD(&(precvframe->u.list)); INIT_LIST_HEAD(&(precvframe->u.list));
list_insert_tail(&(precvframe->u.list), list_add_tail(&(precvframe->u.list),
&(precvpriv->free_recv_queue.queue)); &(precvpriv->free_recv_queue.queue));
r8712_os_recv_resource_alloc(padapter, precvframe); r8712_os_recv_resource_alloc(padapter, precvframe);
precvframe->u.hdr.adapter = padapter; precvframe->u.hdr.adapter = padapter;

View File

@ -66,7 +66,7 @@ u32 _r8712_init_sta_priv(struct sta_priv *pstapriv)
for (i = 0; i < NUM_STA; i++) { for (i = 0; i < NUM_STA; i++) {
_init_stainfo(psta); _init_stainfo(psta);
INIT_LIST_HEAD(&(pstapriv->sta_hash[i])); INIT_LIST_HEAD(&(pstapriv->sta_hash[i]));
list_insert_tail(&psta->list, list_add_tail(&psta->list,
get_list_head(&pstapriv->free_sta_queue)); get_list_head(&pstapriv->free_sta_queue));
psta++; psta++;
} }
@ -137,7 +137,7 @@ struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
goto exit; goto exit;
} }
phash_list = &(pstapriv->sta_hash[index]); phash_list = &(pstapriv->sta_hash[index]);
list_insert_tail(&psta->hash_list, phash_list); list_add_tail(&psta->hash_list, phash_list);
pstapriv->asoc_sta_count++; pstapriv->asoc_sta_count++;
/* For the SMC router, the sequence number of first packet of WPS handshake /* For the SMC router, the sequence number of first packet of WPS handshake
@ -208,7 +208,7 @@ void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta)
} }
spin_lock(&(pfree_sta_queue->lock)); spin_lock(&(pfree_sta_queue->lock));
/* insert into free_sta_queue; 20061114 */ /* insert into free_sta_queue; 20061114 */
list_insert_tail(&psta->list, get_list_head(pfree_sta_queue)); list_add_tail(&psta->list, get_list_head(pfree_sta_queue));
spin_unlock(&(pfree_sta_queue->lock)); spin_unlock(&(pfree_sta_queue->lock));
} }

View File

@ -103,7 +103,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
pxframe->pkt = NULL; pxframe->pkt = NULL;
pxframe->buf_addr = NULL; pxframe->buf_addr = NULL;
pxframe->pxmitbuf = NULL; pxframe->pxmitbuf = NULL;
list_insert_tail(&(pxframe->list), list_add_tail(&(pxframe->list),
&(pxmitpriv->free_xmit_queue.queue)); &(pxmitpriv->free_xmit_queue.queue));
pxframe++; pxframe++;
} }
@ -143,7 +143,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
((addr_t) (pxmitbuf->pallocated_buf) & ((addr_t) (pxmitbuf->pallocated_buf) &
(XMITBUF_ALIGN_SZ - 1)); (XMITBUF_ALIGN_SZ - 1));
r8712_xmit_resource_alloc(padapter, pxmitbuf); r8712_xmit_resource_alloc(padapter, pxmitbuf);
list_insert_tail(&pxmitbuf->list, list_add_tail(&pxmitbuf->list,
&(pxmitpriv->free_xmitbuf_queue.queue)); &(pxmitpriv->free_xmitbuf_queue.queue));
pxmitbuf++; pxmitbuf++;
} }
@ -767,7 +767,7 @@ int r8712_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
return _FAIL; return _FAIL;
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irqL); spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irqL);
list_delete(&pxmitbuf->list); list_delete(&pxmitbuf->list);
list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue)); list_add_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue));
pxmitpriv->free_xmitbuf_cnt++; pxmitpriv->free_xmitbuf_cnt++;
spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL); spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL);
return _SUCCESS; return _SUCCESS;
@ -833,7 +833,7 @@ void r8712_free_xmitframe(struct xmit_priv *pxmitpriv,
pndis_pkt = pxmitframe->pkt; pndis_pkt = pxmitframe->pkt;
pxmitframe->pkt = NULL; pxmitframe->pkt = NULL;
} }
list_insert_tail(&pxmitframe->list, get_list_head(pfree_xmit_queue)); list_add_tail(&pxmitframe->list, get_list_head(pfree_xmit_queue));
pxmitpriv->free_xmitframe_cnt++; pxmitpriv->free_xmitframe_cnt++;
spin_unlock_irqrestore(&pfree_xmit_queue->lock, irqL); spin_unlock_irqrestore(&pfree_xmit_queue->lock, irqL);
if (netif_queue_stopped(padapter->pnetdev)) if (netif_queue_stopped(padapter->pnetdev))
@ -940,9 +940,9 @@ sint r8712_xmit_classifier(struct _adapter *padapter,
psta, pattrib->priority); psta, pattrib->priority);
spin_lock_irqsave(&pstapending->lock, irqL0); spin_lock_irqsave(&pstapending->lock, irqL0);
if (list_empty(&ptxservq->tx_pending)) if (list_empty(&ptxservq->tx_pending))
list_insert_tail(&ptxservq->tx_pending, list_add_tail(&ptxservq->tx_pending,
get_list_head(pstapending)); get_list_head(pstapending));
list_insert_tail(&pxmitframe->list, list_add_tail(&pxmitframe->list,
get_list_head(&ptxservq->sta_pending)); get_list_head(&ptxservq->sta_pending));
ptxservq->qcnt++; ptxservq->qcnt++;
spin_unlock_irqrestore(&pstapending->lock, irqL0); spin_unlock_irqrestore(&pstapending->lock, irqL0);